Commits

Anonymous committed 40f6018

Added perms for files.

  • Participants
  • Parent commits 7a344db

Comments (0)

Files changed (2)

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

                     filename => $result->basename(),
                     mtime => strftime("%Y-%m-%dT%H:%M:%S", localtime($stat[9])),
                     size => $stat[7],
+                    perms => sprintf("%04o", ($stat[2]&07777)),
                     depth => scalar(@{$result->full_components()}),
                 }
             );

File File-Dir-Dumper/t/dumper.t

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