Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When is a file considered to be accessed

Status
Not open for further replies.

RPrinceton

Programmer
Jan 8, 2003
86
US
Hi Everyone,
I am using the code snippet below to obtain the last access timestamp of a file. It returns the same timestamp even though I have opened and closed the file with another application. My question is this. What constitutes a "File Access" i.e., when does the file access attribute get updated?
Thanks in advance.
RPrinceton

code snippet:
File::Stat qw:)FIELDS);
$mvFileNM = "abc";
stat($mvFileNM) or die "No $mvFileNM: $!";
$mvFileLastAccTS = localtime($st_atime);

 
Hi,

No good answer to this one I'm afraid. Last access time is very dependant on which platform (operating system) you use it on.

I don't write code anymore but when I did I tried to write platform independant code - so I never used this.

Mike

The options are: fast, cheap and right - pick any two. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top