in reply to Re^2: I am really stuck here....PLEASE HELP.
in thread Invalid File Handle???
Thanks a lot guysuse strict; use File::Find; use File::stat; use File::Spec; use Time::localtime; system("cls"); my $start_time = ctime(); print "\nStart Time: $start_time\n\n"; print "Full Path,Size (Byte),Created,Modified,Accessed,File Name,Type\ +n"; find(\&stat_files, @ARGV); sub stat_files { return unless -f; my $sb = stat ($File::Find::name); my $size = $sb->size; my $ct = localtime $sb->ctime; my $mt = localtime $sb->mtime; my $at = localtime $sb->atime; my $creation_time; my $modified_time; my $accessed_time; eval {$creation_time = $ct->mday()."/".($ct->mon()+1)."/".(($ct->y +ear)+1900);}; $creation_time = '-' if $@; undef $@; eval {$modified_time = $mt->mday()."/".($mt->mon()+1)."/".(($mt->y +ear)+1900);}; $modified_time = '-' if $@; undef $@; eval {$accessed_time = $at->mday()."/". ($at->mon()+1)."/".(($at-> +year)+1900);}; $accessed_time = '-' if $@; undef $@; my ($volume,$directories,$file) = File::Spec->splitpath($File::Fin +d::name); my $ext = $file; $ext =~ s/.+\.(.+)$//; $File::Find::name =~ tr/,/-/; print "$File::Find::name,$size,$creation_time,$modified_time,$acce +ssed_time,$file,$1\n"; } my $end_time = ctime(); print "\nEnd Time: $end_time\n";
|
|---|