Project

General

Profile

Bug #7821

FileUtils.mkdir_p fails on Windows Unicode paths (\\?\UNC\) if dir already exists

Added by Patrick Pokatilo about 3 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
ruby -v:
ruby 1.9.3p362 (2012-12-25) [i386-mingw32]
Backport:
[ruby-core:52097]

Description

Code:
FileUtils.mkdir_p "//?/C:/test"
FileUtils.mkdir_p "//?/C:/test"

What I expected:
Ruby will create directory C:\test on the first call and nothing on the second

What happened on the second call:
Errno::EACCESS: Permission denied - \?\C:
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:247:in mkdir'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:247:in
fu_mkdir'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:221:in block (2 levels) in mkdir_p'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:219:in
reverse_each'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:219:in block in mkdir_p'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:205:in
each'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:205:in mkdir_p'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:247:in
mkdir'
from C:/ruby/1.9.3-p362/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir'


Related issues

Related to Ruby trunk - Bug #7822: Dir.mkdir can't handle long Windows Unicode paths (\\?\UNC\) Rejected 02/10/2013

History

#1 [ruby-core:52194] Updated by Usaku NAKAMURA about 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA
  • Target version set to 2.0.0

#2 [ruby-core:52482] Updated by Yusuke Endoh about 3 years ago

Usa-san, how significant is this issue?

--
Yusuke Endoh mame@tsg.ne.jp

#3 [ruby-core:52571] Updated by Yusuke Endoh about 3 years ago

  • Target version changed from 2.0.0 to next minor

Looks not so critical.

--
Yusuke Endoh mame@tsg.ne.jp

#4 [ruby-core:62054] Updated by Eric Loveland about 2 years ago

This is actually due to a bug in File.directory?

File.directory?("\\\\?\\C:")

returns false. New bug for this?

#5 [ruby-core:62055] Updated by Usaku NAKAMURA about 2 years ago

The path with "\?\" must be fullpath.
It's the spec of Windows.

#6 [ruby-core:62057] Updated by Usaku NAKAMURA about 2 years ago

  • Related to Bug #7822: Dir.mkdir can't handle long Windows Unicode paths (\\?\UNC\) added

#7 [ruby-core:62059] Updated by Usaku NAKAMURA about 2 years ago

  • Status changed from Assigned to Rejected

See #7822.

Also available in: Atom PDF