This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.utime() that works on symlinks?
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: jackjansen, landley, loewis
Priority: normal Keywords:

Created on 2002-10-15 21:47 by landley, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (3)
msg53664 - (view) Author: Rob Landley (landley) Date: 2002-10-15 21:47
I can query a symlink's timestamps with os.lstat(), but can't 
set them.  Any attempt to set the timestamps on a symlink is 
transparently redirected to the file it points to (which in this 
case is on a read-only partition, as is not what I want to do 
anyway).

Maybe os.lutime()?
msg53665 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-10-15 22:10
Logged In: YES 
user_id=45365

Is there a way to do this from a C program? os.utime() is simply a wrapper around the C library call of the same name, and I'm not aware of a lutime() on systems I'm familiar with...
msg53666 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-11-04 10:17
Logged In: YES 
user_id=21627

It's not possible to implement this feature: the operating
system provides no mechanism to modify the timestamp of a
symlink. The closest you can get is to remove and recreate
the symlink, but that uses the current time, not the one you
would give to utime.
History
Date User Action Args
2022-04-10 16:05:45adminsetgithub: 37328
2002-10-15 21:47:43landleycreate