From: nobu.nokada@... Date: 2002-01-28T00:30:36+09:00 Subject: Re: Dir[] and File.stat(str).directory? on Win98 Hi, At Sun, 27 Jan 2002 23:54:11 +0900, Stephan K�mper wrote: > Now that seems to be kind of inconststent to me. "File.stat" works > as I think it should. But "Dir[]" only works with unixish file names, > not with the dosish backslashes... > > Is this intended behaviour? Can I somehow set File::SEPARATOR to > something different from /? Would that help anyway? Yes, intended. You shouldn't set the constant and it even has no meanings. It's provided for scripts and never used internally. > As far as I see I could work around this by redefining Dir[] so that > it gsubs any \es into /es and then calls the original Dir[]... In 1.7 of mingw32 and mswin32, Dir[] accepts backslashes. > But how would I 'alias' a class method correctly? if /mswin|mingw/ =~ RUBY_PLATFORM and RUBY_VERSION < "1.7" class << Dir # <=== alias _search [] def [](path) _search(path.gsub(/\\/, '/')) end end end -- Nobu Nakada