Actions
Feature #13743
closedSupport linking of files opened with O_TMPFILE
Feature #13743:
Support linking of files opened with O_TMPFILE
Description
Files
Actions
Added by Glass_saga (Masaki Matsushita) about 9 years ago. Updated about 9 years ago.
Description
Files
| patch.diff (2.44 KB) patch.diff | Glass_saga (Masaki Matsushita), 07/13/2017 11:15 AM |
Extension of File.link, but not File#link?
glass.saga@gmail.com wrote:
Feature #13743: Support linking of files opened with O_TMPFILE
https://bugs.ruby-lang.org/issues/13743
I like this feature.
patch.diff (2.44 KB)
However, PATH_MAX (4096 on Linux) is excessive use of stack.
Since fd is an int, we can safely set a smaller size.
Also, I'm not sure why rb_io_flush needs to be called, here.
Thanks.
I feel this is too Linux and environment specific.
For example, it depends /proc/fd.
I think that it is better to provide linkat(2) directly.
(Extend File.link or add File.linkat.)
This API is pretty simple but only works on Linux. I am not positive to add platform-specific features to the language core. I'd rather recommend considering making it a gem.
Matz.