This repository has been archived by the owner on Jul 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Use Linux' O_TMPFILE for tmpfiles #2
Labels
Comments
untitaker
changed the title
Use Linux' API for tmpfiles
Use Linux' O_TMPFILE for tmpfiles
Feb 6, 2015
Unsure how to call |
Something like this seems to work since Python 3.4: import os
fd = os.open('.', os.O_TMPFILE | os.O_RDWR)
path = '/proc/self/fd/{0}'.format(fd)
os.link(path, 'spam', src_dir_fd=0, follow_symlinks=True) |
@jwilk That doesn't seem particularly performant or elegant though. It seems that there is a package on PyPI that provides bindings for this call, however, that would be quite a microdependency. |
AFAICT NamedTemporaryFile already sets this flag |
I think you meant (unnamed) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
untitaker/rust-atomicwrites#2
The text was updated successfully, but these errors were encountered: