Commits

Anonymous committed 8aa3cf6

Added the perms for the directory.

  • Participants
  • Parent commits 40f6018

Comments (0)

Files changed (2)

File-Dir-Dumper/lib/File/Dir/Dumper/Scanner.pm

 
         if ($result->is_dir())
         {
+            my @stat = stat($result->path());
             $self->_add(
                 {
                     type => "dir",
                     filename => $result->full_components()->[-1],
                     depth => scalar(@{$result->full_components()}),
+                    perms => sprintf("%04o", ($stat[2]&07777)),
                 }
             );
         }

File-Dir-Dumper/t/dumper.t

 use strict;
 use warnings;
 
-use Test::More tests => 31;
+use Test::More tests => 32;
 
 use POSIX qw(mktime strftime);
 use File::Path;
     # TEST
     is ($token->{filename}, "b", "dir name is 'b'");
 
+    # TEST
+    is ($token->{perms},
+        sprintf("%04o", ((stat($t->get_path("$test_dir/b/")))[2]&07777)),
+        "perms are OK."
+    );
+
+
     $token = $scanner->fetch();
 
     # TEST