File::Spec equivalent?

(Mark J. Reed) #1

Dumb question: does Ruby have an equivalent to the Perl File::Spec module
(maybe as a built-in part of the File class like Java, instead of in
a separate module) for building and manipulating pathnames portably?

(James Edward Gray II) #2

I can't remember File::Spec right off the top of my head, but does the standard pathname module meet your needs?

http://www.ruby-doc.org/stdlib/libdoc/pathname/rdoc/classes/Pathname.html

http://redhanded.hobix.com/bits/howPowerfulPathnameIs.html

James Edward Gray II

···

On Aug 10, 2005, at 2:36 PM, Mark J.Reed wrote:

Dumb question: does Ruby have an equivalent to the Perl File::Spec module
(maybe as a built-in part of the File class like Java, instead of in
a separate module) for building and manipulating pathnames portably?

(Mark J. Reed) #3

What I'm specificalliy looking for is a version of File.join() that will join
components with backslashes instead of forward slashes on Windows...

James Edward Gray II <james@grayproductions.net> writes:

···

On Aug 10, 2005, at 2:36 PM, Mark J.Reed wrote:

Dumb question: does Ruby have an equivalent to the Perl File::Spec
module
(maybe as a built-in part of the File class like Java, instead of in
a separate module) for building and manipulating pathnames portably?

I can't remember File::Spec right off the top of my head, but does
the standard pathname module meet your needs?

http://www.ruby-doc.org/stdlib/libdoc/pathname/rdoc/classes/
Pathname.html

http://redhanded.hobix.com/bits/howPowerfulPathnameIs.html

James Edward Gray II