Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.utime() that works on symlinks? #37328

Closed
landley mannequin opened this issue Oct 15, 2002 · 4 comments
Closed

os.utime() that works on symlinks? #37328

landley mannequin opened this issue Oct 15, 2002 · 4 comments
Labels
type-feature A feature request or enhancement

Comments

@landley
Copy link
Mannequin

landley mannequin commented Oct 15, 2002

BPO 623782
Nosy @loewis, @jackjansen

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2002-11-04.10:17:18.000>
created_at = <Date 2002-10-15.21:47:43.000>
labels = ['type-feature']
title = 'os.utime() that works on symlinks?'
updated_at = <Date 2002-11-04.10:17:18.000>
user = 'https://bugs.python.org/landley'

bugs.python.org fields:

activity = <Date 2002-11-04.10:17:18.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['None']
creation = <Date 2002-10-15.21:47:43.000>
creator = 'landley'
dependencies = []
files = []
hgrepos = []
issue_num = 623782
keywords = []
message_count = 3.0
messages = ['53664', '53665', '53666']
nosy_count = 3.0
nosy_names = ['loewis', 'jackjansen', 'landley']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue623782'
versions = []

@landley
Copy link
Mannequin Author

landley mannequin commented Oct 15, 2002

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()?

@landley landley mannequin closed this as completed Oct 15, 2002
@landley landley mannequin added the type-feature A feature request or enhancement label Oct 15, 2002
@landley landley mannequin closed this as completed Oct 15, 2002
@landley landley mannequin added the type-feature A feature request or enhancement label Oct 15, 2002
@jackjansen
Copy link
Member

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...

@loewis
Copy link
Mannequin

loewis mannequin commented Nov 4, 2002

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
@PuppyPi
Copy link

PuppyPi commented Jun 16, 2022

man 3 lutimes

int lutimes(const char *filename, const struct timeval tv[2]);

(Perhaps it wasn't present in 2002, but it is now!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants