[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: File::Separator on win32

Berger, Daniel

7/24/2006 4:37:00 PM

Michael Siebert wrote:
> is ALT_SEPARATOR / on *nixes? according to the docs, its \, too. i need a
> portable way without the need to rewrite everything...

Which docs? Anyway, it's nil on *nix platforms. I'm not sure about VMS, though.

There's always RUBY_PLATFORM.match('mswin') :)

Regards,

Dan

>
> 2006/7/24, Berger, Daniel <Daniel.Berger@qwest.com>:
>>
>> > -----Original Message-----
>> > From: Michael Siebert [mailto:info@siebert-wd.de]
>> > Sent: Monday, July 24, 2006 10:26 AM
>> > To: ruby-talk ML
>> > Subject: File::Separator on win32
>> >
>> >
>> > 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?
>>
>> Use File::ALT_SEPARATOR instead.
>>
>> Regards,
>>
>> Dan
>>
>>
>> This communication is the property of Qwest and may contain confidential
>> or
>> privileged information. Unauthorized use of this communication is
>> strictly
>> prohibited and may be unlawful. If you have received this communication
>> in error, please immediately notify the sender by reply e-mail and
>> destroy
>> all copies of the communication and any attachments.
>>
>>
>
>


1 Answer

Brian Hartin

5/23/2008 5:52:00 PM

0

Daniel Berger wrote:
> Michael Siebert wrote:
>> is ALT_SEPARATOR / on *nixes? according to the docs, its \, too. i need a
>> portable way without the need to rewrite everything...
>
> Which docs? Anyway, it's nil on *nix platforms. I'm not sure about
> VMS, though.
>
> There's always RUBY_PLATFORM.match('mswin') :)
>
> Regards,
>
> Dan

`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?
--
Posted via http://www.ruby-....