Modify Attributes

Is there a way of changing the file access date? i.e. the date a file was last modified.

Thanks in advance.
onalennaAsked:
Who is Participating?
 
chris_calabreseConnect With a Mentor Commented:
Yes.  See the man page for the touch command and the utime() system call.
0
 
onalennaAuthor Commented:
Edited text of question.
0
 
ArtimageCommented:
The easiest way to change the access date of a file is the touch command. ie. touch filename .. This will change the files access time, modification time, and change time to now. (Now being whenever the touch command was issued.)
Touch can be used to set a modification time to a certian value. ie touch date filename, where date is modyhrmiyy  .. But the access time is controlled by the system, I believe. So you would have to change the system clock, touch the file, and then change the clock back.

Art.-
0
All Courses

From novice to tech pro — start learning today.