[ruby-core:68011] [ruby-trunk - Bug #10819] can't glob win32 short pathname

From: usa@...
Date: 2015-02-04 20:35:20 UTC
List: ruby-core #68011
Issue #10819 has been updated by Usaku NAKAMURA.


1. We should not assume that short filenames always contains `~`.
   MSDN says that some file systems do not use `~` for short filenames.
   (But I don't know such file systems.)
   See Remarks section of https://msdn.microsoft.com/en-us/library/windows/desktop/aa364980%28v=vs.85%29.aspx .

2. FindFirstFile API handles short filenames with wildcards.
   Simply we can test it by `dir C:\PROGRA~*`.

These are only for your information.
I'm not claiming that ruby needs complete support of short filenames.

----------------------------------------
Bug #10819: can't glob win32 short pathname 
https://bugs.ruby-lang.org/issues/10819#change-51399

* Author: Akio Tajima
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x64-mswin64_100]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
----------------------------------------
I used to install ruby under the "c:/program files" and use to apply windows short pathname such as "c:/progra~1" and it worked fine.
However, rubygems on ruby 2.2.0 failed to look up gemspec. After some investigation, I found that ruby 2.2.0 failed to glob with short pathname.

for ex) `ruby -e 'p Dir.glob("c:/progra~1/*")' #=> []`

Also I found that the inter glob string with shortname+wildcard also failed both Ruby 2.1.0 and 2.2.0.

for ex) `ruby -e 'p Dir.glob("C:/progra~*/*")' #=> []`

The testcase is below.

~~~ruby
assert_equal Dir.glob('C:/Program Files*/m*').size, Dir.glob('c:/Progra~*/m*').size
~~~



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next