# File::Separator on win32

**URL:** <https://www.ruby-forum.com/t/file-separator-on-win32/99644>\
**Category:** Ruby\
**Created:** [July 24, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/file-separator-on-win32/99644 "2006-07-24T18:29:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [July 24, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/file-separator-on-win32/99644/1 "2006-07-24T18:29:33Z")

</div>

Hello Folks,

on my win32 machine, File::Separator returns / instead of a .  
this confuses the system so that it cant find the files i need.  
is there a way round? is this a bug or wanted behaviour?

greets

–  
Michael S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

[www.stellar-legends.de](http://www.stellar-legends.de) - Weltraum-Browsergame im Alpha-Stadium

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [July 24, 2006, 6:32pm UTC](https://www.ruby-forum.com/t/file-separator-on-win32/99644/2 "2006-07-24T18:32:46Z")

</div>

Michael S. wrote:

> Hello Folks,
> 
> on my win32 machine, File::Separator returns / instead of a .  
> this confuses the system so that it cant find the files i need.  
> is there a way round? is this a bug or wanted behaviour?

It shouldn’t be a problem - Windows uses / and \ pretty much  
interchangeably for most things. What’s the code that’s giving you  
problems?

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [July 24, 2006, 6:36pm UTC](https://www.ruby-forum.com/t/file-separator-on-win32/99644/3 "2006-07-24T18:36:16Z")

</div>

FileUtils::cp says ENOENT and thats not good. the path is exactly right  
but  
with /'es

2006/7/24, Alex Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> problems?
> 
> –  
> Alex

–  
Michael S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

[www.stellar-legends.de](http://www.stellar-legends.de) - Weltraum-Browsergame im Alpha-Stadium

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [May 23, 2008, 7:51pm UTC](https://www.ruby-forum.com/t/file-separator-on-win32/99644/4 "2008-05-23T19:51:13Z")

</div>

Michael S. wrote:

> FileUtils::cp says ENOENT and thats not good. the path is exactly right  
> but  
> with /'es
> 
> 2006/7/24, Alex Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > problems?
> > 
> > –  
> > Alex
> 
> –  
> Michael S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> [www.stellar-legends.de](http://www.stellar-legends.de) - Weltraum-Browsergame im Alpha-Stadium

`md #{File.join("c:","foo")}` fails as well. STDERR contains ‘The  
syntax of the command is incorrect’.

In other languages, like Java, the path separator constant/method is  
used to abstract the knowledge of which operating system is in play.  
Can it not be so in Ruby?
