Afficher un message
Vieux 14/09/2007, 11h12   #2
Dan Zwell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: wrong File::SEPARATOR ?

Ronald Fischer wrote:
> On my Ruby 1.8.5 under Windows, I have:
>
> C:> ruby -e 'puts File::SEPARATOR'
> /
>
> Shouldn't it output '\' instead?
>
> Ronald


Nope, this variable correct because within ruby and its core libraries,
everything can open files with forward slash separated paths. Try it. It
is probably more reliable than using paths with backslashes (no
potential for confusing the file separator with the escape character).
Now, if you need to pass the path to a non-ruby app, then you will need
to convert them to backslashes.

Dan

  Réponse avec citation
 
Page generated in 0,05331 seconds with 9 queries