On 5/23/05, nobu.nokada / softhome.net <nobu.nokada / softhome.net> wrote:
> At Tue, 24 May 2005 03:12:08 +0900,
> Austin Ziegler wrote in [ruby-core:05076]:
> > > In file.c, whether a given path is UNC or not is judged by if
> > > it starts with successive 2 directory separators. Is it
> > > insufficient?
> > Vastly. The following is not a valid UNC path:
> >
> >   \\server
> >
> > It's only a server name. UNC paths must include the server and
> > share:
> >
> >   \\server\share
> >
> > So the above is equivalent to C:\.
> Do you mean that open('//server') should try to access
> 'c:/server' where the current drive is C:?

No. That's the bizarre part. Simply doing //server will result in an
error. (See the result of "dir \\Windows" at the command-line).

> > I'll also point out that File#basename and File#dirname do NOT work
> > correctly with UNC paths.
> How wrong?

irb(main):008:0> unc = "\\\\server\\share\\dir1\\dir2\\file.txt"
=> "\\\\server\\share\\dir1\\dir2\\file.txt"
irb(main):009:0> File.dirname(unc)
=> "\\\\server\\share\\dir1\\dir2"
irb(main):010:0> File.dirname(File.dirname(unc))
=> "\\\\server\\share\\dir1"
irb(main):011:0> File.dirname(File.dirname(File.dirname(unc)))
=> "\\\\server\\share"
irb(main):012:0> File.dirname(File.dirname(File.dirname(File.dirname(unc))))
=> "\\\\server"
irb(main):013:0>
File.dirname(File.dirname(File.dirname(File.dirname(File.dirname(unc)))))
=> "\\\\"

As noted, \\server is not a valid UNC path. \\server\share is
equivalent to C:\.  In all cases \\\\ is invalid.

> > I'd also like to reiterate my call for supporting wide filename
> > access through UTF-8 on Windows. There are things that I cannot do
> > in Ruby because I don't have access to these calls.
> It's another story to be in another thread.

Yes. I'll raise it again. I *can* write the changes -- but they're
significant and probably depend on the m17n strings that Ruby 2.0 is
supposed to provide. This is definitely not a Ruby 1.8 item.

-austin
-- 
Austin Ziegler * halostatue / gmail.com
               * Alternate: austin / halostatue.ca