# Windows/X-plaiform file path manipulation -- how do you deal

**URL:** <https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312>\
**Category:** Ruby\
**Created:** [September 2, 2006, 4:05am UTC](https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312 "2006-09-02T04:05:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 4:05am UTC](https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312/1 "2006-09-02T04:05:58Z")

</div>

Folks:

Could someone please straighten me out on how the Ruby community deals  
with  
the simple issues of file names and path manipulation on Windows,  
preferably  
in a cross platform way?

So far as I can tell, pathname.rb as distributed with 1.8.4 does not  
deal  
with Windows paths.

(Comments within say it’s unix-only, though the online docs at  
[RDoc Documentation](http://www.ruby-doc.org/stdlib/) claim Windows support, but appear to be  
extracted from wrong version of pathname.rb).

On the basis that there are many ruby programmers working on Windows and  
presumably needing to actually work with files, I’m hesitant to conclude  
that this area of functionality isn’t covered somehow.

What gives?

Graham

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 4:38am UTC](https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312/2 "2006-09-02T04:38:05Z")

</div>

… so to partly answer myself, it looks like the  
at-least-experimentally-working Pathname library is available in the 1.9  
distribution, and indeed does what I want.

Leading to the next question posted…

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 5:15am UTC](https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312/3 "2006-09-02T05:15:48Z")

</div>

Graham W. wrote:

> [RDoc Documentation](http://www.ruby-doc.org/stdlib/) claim Windows support, but appear to be  
> extracted from wrong version of pathname.rb).
> 
> On the basis that there are many ruby programmers working on Windows and  
> presumably needing to actually work with files, I’m hesitant to conclude  
> that this area of functionality isn’t covered somehow.
> 
> What gives?
> 
> Graham

Use pathname2 instead. Available on the RAA.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 12:22pm UTC](https://www.ruby-forum.com/t/windows-x-plaiform-file-path-manipulation-how-do-you-deal/67312/4 "2006-09-02T12:22:12Z")

</div>

Dan:

Good to know about. Thanks,

Graham
