Project

General

Profile

Feature #11583

Add File#unlink

Added by ksss (Yuki Kurihara) about 4 years ago. Updated about 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

I propose new method File#unlink.

File#unlink is same as Fille.unlink like this.

class File
  def unlink
    File.unlink(path)
  end
end

It is more objective.
And will be able to write duck typeing with Tempfile#unlink

- Tempfile.open do |f|
+ Tempfile.create do |f|
  f.unlink # Not raise an error
end

Files

file-unlink.patch (1.44 KB) file-unlink.patch ksss (Yuki Kurihara), 10/12/2015 04:28 AM

Related issues

Related to Ruby master - Feature #11218: File.open FILE_SHARE_DELETEClosedActions

History

#1

Updated by kosaki (Motohiro KOSAKI) about 4 years ago

Unix can unlink an opend file, but windows doesnt. usa-san, what do you think about this patch?

#2

Updated by usa (Usaku NAKAMURA) about 4 years ago

Of cource, it's nonsence for me.

#3

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

Also available in: Atom PDF