Hi, At Tue, 24 May 2005 12:22:41 +0900, Austin Ziegler wrote in [ruby-core:05082]: > > 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). Thank you, understood. How should we deal with that invalid path? In UNIX convention, there's no invalid form of path. Just accessible or not at open(2) etc. > 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" You are saying the latter also should return one same as the former, aren't you? $ ruby -e 'p File.dirname("//share/server")' "//share/server"
Index: file.c =================================================================== RCS file: /cvs/ruby/src/ruby/file.c,v retrieving revision 1.199 diff -U2 -p -r1.199 file.c --- file.c 18 Apr 2005 15:01:19 -0000 1.199 +++ file.c 24 May 2005 06:23:14 -0000 @@ -2720,6 +2720,6 @@ rb_file_s_dirname(klass, fname) root = skiproot(name); #ifdef DOSISH_UNC - if (root > name + 2 && isdirsep(*name)) - name = root - 2; + if (root > name + 1 && isdirsep(*name)) + root = skipprefix(name = root - 2); #else if (root > name + 1)
-- Nobu Nakada