Indeed. This is why all paths generated using the pathname2 package
convert all forward slashes to backslashes. Also, the various PathXXX
functions do NOT work with forward slashes.
irb(main):001:0> require 'Win32API'
irb(main):002:0> PathIsRoot = Win32API.new('shlwapi', 'PathIsRoot', 'P',
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.
From: Austin Ziegler [mailto:firstname.lastname@example.org]
Sent: Wednesday, September 06, 2006 11:15 AM
To: ruby-talk ML
Subject: Re: A little idiom I like
On 9/4/06, Hal Fulton <email@example.com> wrote:
> Rick DeNatale wrote:
>> No easily, even if you can figure out how to define a
method named \
>> or "\\" it's going to be messy sending it.
> If we're seriously talking about a Windows usage, let me point out
> that it's only on the command line that \ is needed.
> Internally, WIndows paths can use ordinary slashes (in
every case I'm
> familiar with).
The reality of the matter is that with the APIs that Ruby is
currently using -- which are problematic for certain cases
(Unicode) -- the \ and / are interchangeable internally.
The advanced APIs -- the Unicode ones and the ones that make
it possible to have very long path names -- requires \.