Project

General

Profile

Actions

Bug #13008

closed

File::basename fails if extension contains a colon

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

Status:
Closed
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 7 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 7 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.

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Closed

Applied in changeset r57009.


file.c: cygwin behavior

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0