Project

General

Profile

Actions

Feature #7361

closed

Adding Pathname#touch

Added by aef (Alexander E. Fischer) about 12 years ago. Updated over 8 years ago.

Status:
Rejected
Target version:
-
[ruby-core:49374]

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

new_file = 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 2 (0 open2 closed)

Related to Ruby master - Feature #7378: Adding Pathname#writeClosedakr (Akira Tanaka)06/02/2012Actions
Related to Ruby master - Feature #17295: Feature: Create a directory and file with Pathname#touchRejectedakr (Akira Tanaka)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0