# Can File::join be used on Windows?

**URL:** <https://www.ruby-forum.com/t/can-file-join-be-used-on-windows/92788>\
**Category:** Ruby\
**Created:** [April 24, 2007, 5:45am UTC](https://www.ruby-forum.com/t/can-file-join-be-used-on-windows/92788 "2007-04-24T05:45:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [April 24, 2007, 5:45am UTC](https://www.ruby-forum.com/t/can-file-join-be-used-on-windows/92788/1 "2007-04-24T05:45:25Z")

</div>

I use File::join perfect on Linux, but when I use it on Windows, it  
still  
use “/” to separate file path rather than “”. Does it mean File::join  
can  
not be used on Windows?

---

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [April 24, 2007, 6:08am UTC](https://www.ruby-forum.com/t/can-file-join-be-used-on-windows/92788/2 "2007-04-24T06:08:27Z")

</div>

On 4/24/07, huang zhimin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I use File::join perfect on Linux, but when I use it on Windows, it still  
> use “/” to separate file path rather than "". Does it mean File::join can  
> not be used on Windows?
> 
> –  
> removed\_email\_address@domain.invalid

Here is one discussion about that topic.  
[http://www.ruby-forum.com/topic/50137#16542](http://www.ruby-forum.com/topic/50137#16542)

Harry

---

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [April 24, 2007, 11:10am UTC](https://www.ruby-forum.com/t/can-file-join-be-used-on-windows/92788/3 "2007-04-24T11:10:34Z")

</div>

On 4/24/07, huang zhimin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I use File::join perfect on Linux, but when I use it on Windows, it still  
> use “/” to separate file path rather than "". Does it mean File::join can  
> not be used on Windows?
> 
> –  
> removed\_email\_address@domain.invalid

Apart from the discussion indicated by Harry I use it frequently and  
without any problems either under cygwin, either under “pure” Windows  
Ruby.  
I always felt the purpose of File.join is to be multiplatform 😉

Cheers  
Robert
