I have tried $x = $x instead of $x =||....Nothing happened.
right -- cause they're effectively the same, except one is more confusing to see
I have dumped ctime, atime, mtime,...did not show anything different (i.e it crashes in exat area where the script does)!!!
what is the exact (read: copy past for us please) output if you add this:
use Data::Dumper;
print Dumper $sb;
print Dumper $ct;
print Dumper $mt;
print Dumper $at;
Will I still get help from the OPEN SOURCE community on PerlMOnks???????????
Yes, but in order to help us help you, please carefully review the node How (Not) To Ask A Question (especially this part)
| [reply] [d/l] |
OK,....I have found out why,...Its all because of wondeful Microsoft.
It seems that - well according to M$ - some of our .doc and .xls files were created in the year 1850, 1745 and others in the sixteenth century!!! very impressive isn't it? Anyway, a Microsoft rep has been summoned to come here at once and explain as to why is this….hehehehehe
I am glad that yet again with the use of Perl and the help of PerlMonks I have managed to uncover another outrage from M$... I have been gloating all day about Perl and I love it. :-D
VIVA PERLMONKS,…here here.
BTW : This is my final code with error checks of some sort.
use 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";
Thanks a lot guys
*******UPDATE***********
And thanks for the -ve points,...Huh!
| [reply] [d/l] |