Project

General

Profile

Bug #13008

File::basename fails if extension contains a colon

Added by rovf (Ronald Fischer) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-cygwin]
[ruby-core:78497]

Description

 File.basename('a/b/c.d:12')

returns

c.d

but should return

c.d:12

Updated by jeremyevans0 (Jeremy Evans) over 3 years ago

I don't think this is a bug. : is the file stream separator in NTFS (https://blogs.technet.microsoft.com/askcore/2013/03/24/alternate-data-streams-in-ntfs/). On *nix systems, you do get c.d:12.

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

I did think so, but on recent cygwin, touch c.d:12 makes a file "c.d\u{F03A}12".
Seems : is mapped to that Private Use Area character.
I'm not sure if we should support it now.

#3

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset r57009.


file.c: cygwin behavior

  • file.c: recent cygwin hides NTFS specific features. [ruby-core:78497] [Bug #13008]

Also available in: Atom PDF