https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112010-07-11T08:05:18ZRuby Issue Tracking SystemRuby master - Bug #3556: FileUtils.mkdir_p fails trying to create C: under Windowshttps://redmine.ruby-lang.org/issues/3556?journal_id=122582010-07-11T08:05:18Zluislavena (Luis Lavena)luislavena@gmail.com
<ul></ul><p>=begin<br>
Please disregard this bug report.</p>
<p>The root of the issue is a broken VirtualStore folder, used by File redirection service under x64 OS.</p>
<p>Either E-TextEditor or Cygwin installation broke the permissions of it.</p>
<p>Apologizes for the noise.</p>
<p>Thank you.<br>
=end</p> Ruby master - Bug #3556: FileUtils.mkdir_p fails trying to create C: under Windowshttps://redmine.ruby-lang.org/issues/3556?journal_id=122592010-07-11T08:19:45Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #3556: FileUtils.mkdir_p fails trying to create C: under Windowshttps://redmine.ruby-lang.org/issues/3556?journal_id=122602010-07-11T09:39:45Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>At Sun, 11 Jul 2010 05:20:01 +0900,<br>
Luis Lavena wrote in <a href="/issues/3556">[ruby-core:31177]</a>:</p>
<blockquote>
<p>Further investigation pointed that the rescue of<br>
SystemCallError in mkdir_p is evaluating for File.directory?<br>
of dir, when dir has actually been altered inside fu_mkdir:</p>
<p>path = path.sub(%r</\z>, '')</p>
<p>But this change, been made in a local variable, is not seen by mkdir_p.</p>
</blockquote>
<p>This substitution is wrong on Windows.</p>
<blockquote>
<p>So:</p>
<ol>
<li>mkdir_p sends "C:/" to fu_mkdir</li>
<li>fu_mkdir trims it to "C:"</li>
<li>fu_mkdir invokes Dir.mkdir "C:" and Errno::EEXIST is raised</li>
<li>mkdir_p catches it but evaluates File.directory? for "C:/" instead of "C:"</li>
<li>mkdir_p re-raises the exception since File.directory?("C:/") == false</li>
</ol>
<p>If I'm not missing something, that is wrong.</p>
</blockquote>
<p>Note that C:/ and C: don't refere same directory. The latter<br>
is C:., the cwd of C: drive.</p>
<p>At Sun, 11 Jul 2010 08:05:18 +0900,<br>
Luis Lavena wrote in <a href="https://blade.ruby-lang.org/ruby-core/31179">[ruby-core:31179]</a>:</p>
<blockquote>
<p>The root of the issue is a broken VirtualStore folder, used<br>
by File redirection service under x64 OS.</p>
</blockquote>
<p>That means that File.stat on VirtualStore folders isn't<br>
working. It seems like a bug.</p>
<p>--<br>
Nobu Nakada</p>
<p>=end</p> Ruby master - Bug #3556: FileUtils.mkdir_p fails trying to create C: under Windowshttps://redmine.ruby-lang.org/issues/3556?journal_id=122612010-07-11T09:46:03Zluislavena (Luis Lavena)luislavena@gmail.com
<ul></ul><p>=begin<br>
On Sat, Jul 10, 2010 at 9:39 PM, Nobuyoshi Nakada <a href="mailto:nobu@ruby-lang.org" class="email">nobu@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>Note that C:/ and C: don't refere same directory. The latter<br>
is C:., the cwd of C: drive.</p>
</blockquote>
<p>Indeed, after tracing it over debug-land and reading forgotten MSDN<br>
documentation found that I was wrong.</p>
<blockquote>
<p>That means that File.stat on VirtualStore folders isn't<br>
working. It seems like a bug.</p>
</blockquote>
<p>Is not a Ruby bug, it was actually a permission issue caused by a bug<br>
or something by the installer process of E-TextEditor or the cygwin<br>
bundled by it.</p>
<p>I was not able to cd ino %LOCALAPPDATA%\VirtualStore after that.</p>
<p>WOW64 redirection is automatically enabled once a 32bits application<br>
start working on a x64 version of Windows, due the permission issues,<br>
it was not possible FindFirstFileW or GetFileAttributeW to it.</p>
<h2>Thank you for the time you took answering this and again apologize the<br>
noise I have caused.</h2>
<h2>Luis Lavena<br>
AREA 17</h2>
<p>Perfection in design is achieved not when there is nothing more to add,<br>
but rather when there is nothing more to take away.<br>
Antoine de Saint-Exupéry</p>
<p>=end</p>