Issue #13743 has been updated by nobu (Nobuyoshi Nakada).


normalperson (Eric Wong) wrote:
>  However, `PATH_MAX` (4096 on Linux) is excessive use of stack.
>  Since `fd` is an int, we can safely set a smaller size.

```c
static const char self_fd[] = "/proc/self/fd/%d";
char from_path[sizeof(self_fd) - 2 + DECIMAL_SIZE_OF_BITS(sizeof(int))];
```

----------------------------------------
Feature #13743: Support linking of files opened with O_TMPFILE
https://bugs.ruby-lang.org/issues/13743#change-65768

* Author: Glass_saga (Masaki Matsushita)
* Status: Open
* Priority: Normal
* Assignee: Glass_saga (Masaki Matsushita)
* Target version: 2.5
----------------------------------------
This patch enables linking of files opened with O_TMPFILE into file system.
Users can make a temporary file persistent as named file.

```ruby
File.open(".", IO::WRONLY|IO::TMPFILE) do |f|
  f.write("content")
  f.chmod(0600)
  File.link(f, "file_name") # make temporary file persistent
end
```

---Files--------------------------------
patch.diff (2.44 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>