Project

General

Profile

Actions

Feature #13576

open

File#to_path shall be deleted

Added by shyouhei (Shyouhei Urabe) over 4 years ago. Updated over 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:81268]

Description

[Feature #13568] sheds light on situations where a File might not have its corresponding path. I understand that this is a nature of a file in general, that it might or might not have such thing. I don't argue that fact.

Problem is however, that ruby's File class has its to_path method. The to_path method is used internally right before calling open(). The intention is clear that the return value of to_path must be something meaningful as an argument to that function. This is impossible for a O_TEMPFILE -created file descriptor, because such file can never be opened again.

So in general, calling to_path over a File instance is a mistake. Let's not do it.

Actions

Also available in: Atom PDF