Project

General

Profile

Actions

Feature #11583

open

Add File#unlink

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

Status:
Open
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 1 (0 open1 closed)

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

Updated by kosaki (Motohiro KOSAKI) about 9 years ago

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

Actions #2

Updated by usa (Usaku NAKAMURA) about 9 years ago

Of cource, it's nonsence for me.

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0