File::SEPARATOR for W2k? 
Author Message
 File::SEPARATOR for W2k?

I was under the impression that File::SEPARATOR is platform specific. I
tried to find a previous post about this, but didn't dig anything up. Is my
impression wrong?

-------------------------------------------
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>ruby -e 'p File::SEPARATOR'
"/"

C:\>ruby --version
ruby 1.6.3 (2001-03-19) [i386-cygwin]



Tue, 06 Apr 2004 20:48:30 GMT  
 File::SEPARATOR for W2k?
I just updated to 1.6.5 -- still same question:

------------------------------------------
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>ruby --version
ruby 1.6.5 (2001-09-19) [i386-cygwin]

C:\>ruby -e 'p File::SEPARATOR'
"/"

Quote:
> -----Original Message-----

> Sent: Friday, October 19, 2001 7:49 AM

> Subject: [ruby-talk:22736] File::SEPARATOR for W2k?

> I was under the impression that File::SEPARATOR is platform
> specific. I
> tried to find a previous post about this, but didn't dig
> anything up. Is my
> impression wrong?

> -------------------------------------------
> Microsoft Windows 2000 [Version 5.00.2195]
> (C) Copyright 1985-2000 Microsoft Corp.

> C:\>ruby -e 'p File::SEPARATOR'
> "/"

> C:\>ruby --version
> ruby 1.6.3 (2001-03-19) [i386-cygwin]



Tue, 06 Apr 2004 20:59:56 GMT  
 File::SEPARATOR for W2k?
Ah, it's cygwin that's confusing me, isn't it? Sorry for the noise.
Quote:
> -----Original Message-----

> Sent: Friday, October 19, 2001 8:00 AM

> Subject: [ruby-talk:22737] RE: File::SEPARATOR for W2k?

> I just updated to 1.6.5 -- still same question:

> ------------------------------------------
> Microsoft Windows 2000 [Version 5.00.2195]
> (C) Copyright 1985-2000 Microsoft Corp.

> C:\>ruby --version
> ruby 1.6.5 (2001-09-19) [i386-cygwin]

> C:\>ruby -e 'p File::SEPARATOR'
> "/"



Tue, 06 Apr 2004 21:07:32 GMT  
 File::SEPARATOR for W2k?

Quote:

> Ah, it's cygwin that's confusing me, isn't it? Sorry for the noise.

Not really noise... I'm afraid!

D:\>ruby --version
ruby 1.6.5 (2001-09-19) [i586-mswin32]

D:\>ruby -e 'p File::SEPARATOR'
"/"

-- CB



Tue, 06 Apr 2004 21:11:50 GMT  
 File::SEPARATOR for W2k?

M> Ah, it's cygwin that's confusing me, isn't it?

 no,

Guy Decoux



Tue, 06 Apr 2004 21:12:29 GMT  
 File::SEPARATOR for W2k?

Quote:
> M> Ah, it's cygwin that's confusing me, isn't it?

Christian

Quote:
> Not really noise... I'm afraid!

> D:\>ruby --version
> ruby 1.6.5 (2001-09-19) [i586-mswin32]

> D:\>ruby -e 'p File::SEPARATOR'
> "/"

Guy

Quote:
>  no,

Well, I realized that cygwin always presents nix style paths, and that's
probably why File::SEPARATOR was showing that. Am I wrong?

Chris



Tue, 06 Apr 2004 22:14:09 GMT  
 File::SEPARATOR for W2k?

M> Well, I realized that cygwin always presents nix style paths, and that's
M> probably why File::SEPARATOR was showing that. Am I wrong?

 File::SEPARATOR is always "/"

 On DOSish system there is File::ALT_SEPARATOR which is "\\", nil for other
 systems.

Guy Decoux



Tue, 06 Apr 2004 22:21:49 GMT  
 File::SEPARATOR for W2k?
Hi,


  "[ruby-talk:22736] File::SEPARATOR for W2k?" :

Quote:
> I was under the impression that File::SEPARATOR is platform specific. I
> tried to find a previous post about this, but didn't dig anything up. Is my
> impression wrong?

Windows API recognize both `/' and `\' as path separator.
So, this is not wrong behavior.
And, Ruby provides File::ALT_SEPARATOR for platform specific
path separator.

Of course, someone feel that it's strange that the primary
separator is `/'.
I think that it's for compatibility with UNIX like systems.

--



Tue, 06 Apr 2004 22:30:09 GMT  
 File::SEPARATOR for W2k?

Quote:
> Windows API recognize both `/' and `\' as path separator.
> So, this is not wrong behavior.

I don't think this is so:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd /temp
The syntax of the command is incorrect.

C:\>cd \temp

C:\temp>

Of course, you said API, you may not be referring to the shell. But I think
it's moot for me because ruby gets to Windows through cygwin which handles
all of this and presents windows paths to Ruby with "/".

Quote:
> And, Ruby provides File::ALT_SEPARATOR for platform specific
> path separator.

Guy said it's nil for most platforms, I guess w2k is one of them:

C:\>ruby -e 'p File::ALT_SEPARATOR'
nil

Chris



Tue, 06 Apr 2004 22:39:38 GMT  
 File::SEPARATOR for W2k?

M> Guy said it's nil for most platforms, I guess w2k is one of them:

M> C:\>ruby -e 'p File::ALT_SEPARATOR'
M> nil

 cygwin is not considered as a DOSish system :-)

Guy Decoux



Tue, 06 Apr 2004 22:42:17 GMT  
 File::SEPARATOR for W2k?
Hi,


  "[ruby-talk:22748] Re: File::SEPARATOR for W2k?" :

Quote:
> I don't think this is so:

> Microsoft Windows 2000 [Version 5.00.2195]
> (C) Copyright 1985-2000 Microsoft Corp.

> C:\>cd /temp
> The syntax of the command is incorrect.

> C:\>cd \temp

> C:\temp>

> Of course, you said API, you may not be referring to the shell. But I think
> it's moot for me because ruby gets to Windows through cygwin which handles
> all of this and presents windows paths to Ruby with "/".

I think it's moot, too.
But I think that the conclusion should satisfy compatibility
with the existing ruby scripts.

--



Tue, 06 Apr 2004 23:02:17 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Clarion for Dos: text file separator

2. Bracked-R Active File Record Separator

3. File::SEPARATOR

4. Unexpected results using File::SEPARATOR

5. Problems with Separator nodes in VRML-file

6. line separators in file-output

7. How to read files with commas as separators?

8. ASCII File & W2K/XP

9. Know which user opened which file in W2K

10. W2K Pro file system

11. W2K File comment

12. How 2 invoke python 2 read from text file under W2k

 

 
Powered by phpBB® Forum Software