SPUG: stat command in NT

rathmore at bb12.betterbox.net rathmore at bb12.betterbox.net
Tue Oct 3 13:11:27 CDT 2000


Greetings, SPUGers! # End Lurker Mode

How does one go about getting the timestamp on files in the NT world? I've
written a quick script almost straight out of the Cook Book that works
great on Unix but not at all on NT (except on . and ..). Take a look:

use Time::Local;

opendir (DIR, $somedir) or die "can't open $somedir: $!";

while (defined($sourcefile = readdir(DIR))) {
    ($access, $modify, $create) = (stat($sourcefile))[8..10];
    print "$sourcefile : ";
    print "$access : $modify : $create\n";
}
closedir(DIR);


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list