Project

General

Profile

Actions

Feature #6671

open

File.split_all and File.split_root

Added by trans (Thomas Sawyer) over 11 years ago. Updated over 6 years ago.

Status:
Assigned
Target version:
-
[ruby-core:45965]

Description

=begin
Is there a method for this already?

File.split_all('a/b/c') #=> ['a','b','c']

If not I propose it be added. I've had need of such more than a few times.

It's too bad that File.split can't do this, as it would make more sense. And the current method be called split_base.

In addition split_root would be helpful.

root, path = File.split_all('a/b/c')
root #=> 'a'
path #=> 'b/c'
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0