in reply to Getting the Access Date of a file without changing it
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.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting the Access Date of a file without changing it
by slloyd (Hermit) on Dec 14, 2004 at 06:04 UTC | |
by graff (Chancellor) on Dec 14, 2004 at 06:47 UTC | |
by graff (Chancellor) on Dec 14, 2004 at 06:17 UTC |