[New-bugs-announce] [issue45178] Support for linking unnamed temporary files into filesystem on Linux

WGH report at bugs.python.org
Sun Sep 12 19:45:46 EDT 2021


New submission from WGH <wgh at torlan.ru>:

In Linux, it's possible to create an unnamed temporary file in a specified directory by using open with O_TMPFILE flag (as if it was created with random name and immediately unlinked, but atomically). Unless O_EXCL is specified, the file can be then linked into filesystem using linkat syscall.

It would be neat if it was possible in Python.

There're a couple of things missing:

1) tempfile.TemporaryFile creates a file with O_EXCL flag, which prevents linking it into filesystem.

2) linkat must be called with AT_SYMLINK_FOLLOW flag (otherwise EXDEV is returned), which is broken right now (#37612)

----------
components: Library (Lib)
messages: 401676
nosy: WGH
priority: normal
severity: normal
status: open
title: Support for linking unnamed temporary files into filesystem on Linux
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45178>
_______________________________________


More information about the New-bugs-announce mailing list