utime

Ben Pfaff blp@cs.stanford.edu
28 Sep 2001 14:30:27 -0700


Joe Glass <joe@glass.cl.msu.edu> writes:

> Does anyone know how to use the utime function or a similar method (in
> Perl) to set the mtime and atime of a symbolic link?  Whenever I try to
> change the time of a symbolic link, it changes the time of the actual
> file that the link is linked to.  

You can't change the atime of any file, except to the current
time.  From the GNU libc manual:

 - Function: int utime (const char *FILENAME, const struct utimbuf
          *TIMES)

[....]

     The attribute modification time for the file is set to the current
     time in either case (since changing the time stamps is itself a
     modification of the file attributes).

And I don't think you can change the times of a symlink at all.
-- 
"To the engineer, the world is a toy box full of sub-optimized and
 feature-poor toys."
--Scott Adams