timotheecour / Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
http://nim-lang.org/
Other
2 stars 0 forks source link

temp file api #195

Open timotheecour opened 4 years ago

timotheecour commented 4 years ago

links

example use cases

note

for temporary scope / auto-cleanup there are a few options:


scratch below

O_TMPFILE

Issue 21515: Use Linux O_TMPFILE flag in tempfile.TemporaryFile? - Python tracker

python3 -c 'import os; fd=os.open(".", os.O_RDWR | os.O_TMPFILE, 0o600)’
uname -a
Linux ee83eead8c5f 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

https://man7.org/linux/man-pages/man2/openat.2.html has good explanation for O_TMPFILE

          There are two main use cases for O_TMPFILE: ...

O_BENEATH

open() flags: O_TMPFILE and O_BENEATH [LWN.net]

open2

openat2(2) - Linux manual page

maxgrenderjones commented 4 years ago

I'm a git/github newbie so please be gentle, but have just opened #14347 to get support for mkstemps (EDIT: this is now merged)