Global variable for file separtator

Does ruby have a global variable for the file separator? This is really
useful for cross platform programming ( / for unix \ for windows) but I
couldn’t find one in the lists of Ruby’s globals I could dig up. Thanks
again :).

Jeremy Gregorio
gunvalk@cox.net

File::SEPARATOR and File::ALT_SEPARATOR (windows)

···

Jeremy Gregorio (gunvalk@cox.net) wrote:

Does ruby have a global variable for the file separator? This is
really useful for cross platform programming ( / for unix \ for windows)
but I couldn’t find one in the lists of Ruby’s globals I could dig up.
Thanks again :).


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Hi,

···

In message “Global variable for file separtator” on 02/10/04, Jeremy Gregorio gunvalk@cox.net writes:

Does ruby have a global variable for the file separator? This is really
useful for cross platform programming ( / for unix \ for windows) but I
couldn’t find one in the lists of Ruby’s globals I could dig up. Thanks
again :).

File::SEPARATOR and File::ALT_SEPARATOR. But Ruby fundamentally use
“/” on all platforms.

						matz.

Does ruby have a global variable for the file separator? This is really
useful for cross platform programming ( / for unix \ for windows) but I
couldn’t find one in the lists of Ruby’s globals I could dig up. Thanks
again :).

Jeremy Gregorio

It’s not global, but it’s recorded in the File class.

Mostly you shouldn’t have to worry about it. See File.join.

Gavin

···

From: “Jeremy Gregorio” gunvalk@cox.net