Then, if I do something else that actually reads the file content and run that one-liner on it again, I see a small value. Repeating the command again without reading the file will again lead to increasing values in the output.perl -e 'print -A $ARGV[0],$/' test.dat
So, by using the "-A" function, I'm getting the age of the file without changing the access time in the process.
This is with perl 5.8.1 on macosx/darwin/panther (based on BSD unix), but I would expect it to work the same elsewhere. (Then again, maybe this is another one of those things where MS-Windows sets itself apart... I don't know.)
So, until you show us your code that changes the file's access time just by stat'ing the file, I'll assume you must be doing something wrong. (Maybe after you show us your code, someone can point out what you're doing wrong.)
In reply to Re: Getting the Access Date of a file without changing it
by graff
in thread Getting the Access Date of a file without changing it
by slloyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |