Thank you all for your inputs. I went stat() and solved my problem:
# get cur time
`touch curtime`
my $curtime = (stat("curtime"))[9];
unlink "curtime";
# find file age
if (($curtime - (stat($thefile))[9]) > AGE) {
# process $thefile
}
Hi,
I've used the -M operator to find a file's age in days. However, -M returns the age with respect to the program start time. Now that I plan to run my program as a daemon, I need to find a file's age wrt the *current* time. Any body out there knows how I can do that?
Thanks & regards,
Hi,
I receive XML files to extract data from. Some times the files come with invalid XML characters such as 0x3, which caused the XML parser (written in Java) to fail. I'm thinking of a Perl preprocessor to remove the invalid chars. Any body has any idea how this can be done in Perl?
Thanks,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.