Feature #7361

Adding Pathname#touch

Added by Alexander E. Fischer over 1 year ago. Updated over 1 year ago.

[ruby-core:49374]
Status:Assigned
Priority:Normal
Assignee:Akira Tanaka
Category:lib
Target version:next minor

Description

Pathname has an #mkdir method to create a directory at the path, but does not have a #touch method to create an empty file at that path.

There were numerous cases where I had to fallback to using

newfile = Pathname.new('location/for/new/file')
FileUtils.touch(new
file)

instead of simply being able to use:

new_file.touch

I would like to add this method. If you like it, let me know. I will provide a patch then.


Related issues

Related to ruby-trunk - Feature #7378: Adding Pathname#write Closed 06/02/2012

History

#1 Updated by Yusuke Endoh over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Akira Tanaka
  • Target version set to next minor

Also available in: Atom PDF