File::SEPARATOR

Hello,

I would like to emphasize again that in windows 2000 using ruby 1.67-4 

and 1.67-7 downloaded from http://rubyinstaller.sourceforge.net/, I get
"/" as a file separator. I already mentionned this in
http://marc.theaimsgroup.com/?l=ruby-talk&m=103884227229307&w=2, but
there was no reaction.
Am I doing something wrong?

Microsoft Windows 2000 [Version 5.00.2195]
© Copyright 1985-2000 Microsoft Corp.

C:>irb
irb(main):001:0> File::SEPARATOR
"/"
irb(main):002:0>

C:>irb --version
irb 0.7.4(01/05/08)

C:>ruby --version
ruby 1.6.7 (2002-03-01) [i586-mswin32]

thank you,

emmanuel

···


“If someone breaks into my house and steals my CDs,
who calls the cops, me or the music industry?
If it’s me, then that’s my property.”
–Ruben Safir

Hi,

···

At Fri, 6 Dec 2002 23:35:01 +0900, Emmanuel Touzery wrote:

I would like to emphasize again that in windows 2000 using
ruby 1.67-4
and 1.67-7 downloaded from http://rubyinstaller.sourceforge.net/, I
get “/” as a file separator. I already mentionned this in
http://marc.theaimsgroup.com/?l=ruby-talk&m=103884227229307&w=2, but
there was no reaction.

Yes. In ruby, “/” is used as a file separator for portability
reason, and File::ALT_SEPARATOR is set on some platforms.


Nobu Nakada

Hi,

I would like to emphasize again that in windows 2000 using
ruby 1.67-4
and 1.67-7 downloaded from http://rubyinstaller.sourceforge.net/, I
get “/” as a file separator. I already mentionned this in
http://marc.theaimsgroup.com/?l=ruby-talk&m=103884227229307&w=2, but
there was no reaction.

Yes. In ruby, “/” is used as a file separator for portability
reason, and File::ALT_SEPARATOR is set on some platforms.

thank you, now I’m reassured :O)
the doc in the pickaxe book is:

SEPARATOR> Character that separates directory components in a filename
(such as \'' or /‘’).

I gather that this doc is wrong? File::SEPARATOR would always be “/”, in
all platforms? (in which case it’s not really useful).

yes, and Dir.chdir(“a/b”) does work under windows, so it’s good, and i’m
wondering even more when should I use File::SEPARATOR?

much reassured,

emmanuel

···

nobu.nokada@softhome.net wrote:

At Fri, 6 Dec 2002 23:35:01 +0900, >Emmanuel Touzery wrote:


“If someone breaks into my house and steals my CDs,
who calls the cops, me or the music industry?
If it’s me, then that’s my property.”
–Ruben Safir

Hi,

I gather that this doc is wrong? File::SEPARATOR would always be “/”,
in all platforms? (in which case it’s not really useful).

Yes, in all platforms, and I have to agree it’s not so useful.

yes, and Dir.chdir(“a/b”) does work under windows, so it’s good, and
i’m wondering even more when should I use File::SEPARATOR?

Hmmm, I have no idea.

···

At Sat, 7 Dec 2002 00:11:18 +0900, Emmanuel Touzery wrote:


Nobu Nakada