koko973
asked on
How can I get a timestamp of a file in Windows32 system?
I'm reading Windows directry & try to get the timestamps for a file (Last Modified, Last Accessed, File Created). I know there is a function 'stat' or 'lstat' for Unix based perl, but these are not supported in Windows env... Please help me.
short and sloppy...
but it'll get you by.
ts("A");
sub ts
{
$v=shift;
$ret=`dir /T$v`;
@arr=split("\n",$ret);
foreach(@arr)
{
$_=/([^ap]+)(.)/;
push(@arr2,$1 . $2);
}
print join("\n",@arr2);
print "done";
}
but it'll get you by.
ts("A");
sub ts
{
$v=shift;
$ret=`dir /T$v`;
@arr=split("\n",$ret);
foreach(@arr)
{
$_=/([^ap]+)(.)/;
push(@arr2,$1 . $2);
}
print join("\n",@arr2);
print "done";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are good!!!
Thanks a lot :-) Much appreciated.
Thanks a lot :-) Much appreciated.
anytime!!
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
I will see if I can come up with a sub for you.