Eric Amick wrote:
On Thu, 21 Jul 2005 12:05:08 -0700, you wrote:
loris reply:
yes I did try stat ("$dir/$file") it would not work , and I tried many
variation
here is what I finally got to work:
print "Opening $dir \n";
opendir DH, $dir or die "Can't open the current dir $!\n";
while(my $file = readdir(DH)){
if(-d "$dir/$file"){
print "\n Dir: $file \n";
my $pic_year = substr($file,0,4);
my $pic_month = substr($file,4,2);
print "Year: $pic_year,Month: $pic_month\n";
$dir_ctr++;
}
elsif(-e "$dir/$file"){
print "\n File: $dir/$file ";
#this wont work for me
#my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,$atime,
$mtime, $ctime, $blksize, $blocks) = stat("$dir/$file");
#print "Ctime:$ctime ,Mtime: $mtime\n";
my $now = ctime();
print "\n Nowtime: $now\n";
#this works
my $file_moddate = ctime(stat("$dir/$file")->mtime);
my $file_create_date = ctime(stat("$dir/$file")->ctime);
Clearly you directly or indirectly use'd the File::stat module, which
overrides the built-in stat() with an object-oriented version. If you
really want to call the built-in version, try
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,$atime,
$mtime, $ctime, $blksize, $blocks) = CORE::stat("$dir/$file");
----------------------------------------------------------------
Thanks Eric
CORE::stat("$dir/$file");
you are correct if I dont use the File::stat module it will work
so using
CORE::stat("$dir/$file");
also works
lori
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs