[ruby-core:71050] [Ruby trunk - Feature #11583] Add File#unlink

From: kosaki.motohiro@...
Date: 2015-10-12 05:29:08 UTC
List: ruby-core #71050
Issue #11583 has been updated by Motohiro KOSAKI.


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


----------------------------------------
Feature #11583: Add File#unlink
https://bugs.ruby-lang.org/issues/11583#change-54420

* Author: Yuki Kurihara
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I propose new method **File#unlink**.

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

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

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

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

---Files--------------------------------
file-unlink.patch (1.44 KB)


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

In This Thread

Prev Next