Project

General

Profile

Actions

Bug #11906

closed

File.dirname separator stripping from the begining of path

Added by kares (Karol Bucek) over 6 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:72550]

Description

MRI strips additional leading slashes with File.dirname :

File.dirname "////foo/bar/baz"   # => /foo/bar
File.dirname "////foo//bar/baz"  # => /foo//bar

... issue arose as an incompatibility on JRuby's tracker: https://github.com/jruby/jruby/issues/2391
is the current behaviour really intended?

Updated by kosaki (Motohiro KOSAKI) over 6 years ago

MRI normalization uses UNIX style normalization. So, that's intentional. I'm curious why JRuby uses another normalization.
Does it have good use-case?

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

And on Windows, note that \\foo\bar is a valid UNC style path, but \\\foo\bar is not.

Actions #3

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF