Issue #12040 has been reported by Nobuyoshi Nakada.

----------------------------------------
Bug #12040: [Win32] File.stat fails on a mounted volume
https://bugs.ruby-lang.org/issues/12040

* Author: Nobuyoshi Nakada
* Status: Assigned
* Priority: Normal
* Assignee: cruby-windows
* ruby -v: r53705
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
On Windows, `File.stat` fails on the volume mount point directory whose name contains `"..."`.

Where `%vol%` is the volume ID of a new VHD volume,

~~~
C:> set vol
\\?\Volume{3C458AE9-C8B1-11E5-A233-0800271D089F}\
C:> mkdir x...y
C:> mountvol x...y %vol%
C:> .\miniruby -e "p Dir.chdir('x...y'){File.stat('.')}" -e "p File.stat('x...y')"
#<File::Stat dev=0x2, ino=1407374883553285, mode=040755, nlink=1, uid=0, gid=0, rdev=0x2, size=4096, blksize=nil, blocks=nil, atime=2016-02-01 16:35:45 +0900, mtime=2016-02-01 16:35:45 +0900, ctime=2016-02-01 16:35:45 +0900>
-e:2:in `stat': No such file or directory @ rb_file_s_stat - x...y (Errno::ENOENT)
	from -e:2:in `<main>'
~~~

Note that `Dir.chdir` and `File.stat` there succeed.
This failures depends on the mount point name, because of `check_valid_dir()`.



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>