Project

General

Profile

Feature #13568

File#path for O_TMPFILE fds has no meaning

Added by sorah (Sorah Fukumori) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:81164]

Description

By using File::TMPFILE (O_TMPFILE) allows us to create a file without directory entries.

While open(2) with O_TMPFILE don't create a file without directory entries, it still requires a directory name to determine a file system to create a file.

Current Ruby implementation holds such directory names in fptr->pathv and retrievable via File#path.
But such paths are useless and may raise errors. For example, some code 1 checks File#path availability then when available, it attempts to use the path to open a file in different fd, finally raises Errno::EISDIR.

This patch changes File#path (fptr->pathv) not to return String if a fd is opened with O_TMPFILE.


Files

tmpfile-path.patch (1.96 KB) tmpfile-path.patch sorah (Sorah Fukumori), 05/15/2017 10:35 AM
0001-File-path-Raise-IOError-when-a-file-is-O_TMPFILE.patch (3.7 KB) 0001-File-path-Raise-IOError-when-a-file-is-O_TMPFILE.patch sorah (Sorah Fukumori), 08/31/2017 07:02 AM

Related issues

Related to Ruby master - Feature #13577: Digest.file accidentally receives File object but uses file pathAssignednobu (Nobuyoshi Nakada)Actions

Also available in: Atom PDF