Bug #7821

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

Added by Patrick Pokatilo about 1 year ago. Updated 8 days ago.

[ruby-core:52097]
Status:Rejected
Priority:Normal
Assignee:Usaku NAKAMURA
Category:-
Target version:next minor
ruby -v:ruby 1.9.3p362 (2012-12-25) [i386-mingw32] Backport:

Description

Code:
FileUtils.mkdirp "//?/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
fumkdir'
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 Updated by Usaku NAKAMURA about 1 year ago

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

#2 Updated by Yusuke Endoh about 1 year ago

Usa-san, how significant is this issue?

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Yusuke Endoh about 1 year ago

  • Target version changed from 2.0.0 to next minor

Looks not so critical.

Yusuke Endoh mame@tsg.ne.jp

#4 Updated by Eric Loveland 8 days ago

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

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

returns false. New bug for this?

#5 Updated by Usaku NAKAMURA 8 days ago

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

#6 Updated by Usaku NAKAMURA 8 days ago

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

#7 Updated by Usaku NAKAMURA 8 days ago

  • Status changed from Assigned to Rejected

See #7822.

Also available in: Atom PDF