X-Spam-Check-By: sourceware.org From: Jonathan Lennox MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17882.11606.992809.59594@metro-north.cs.columbia.edu> Date: Mon, 19 Feb 2007 18:05:58 -0500 To: cygwin AT cygwin DOT com Subject: Surprising results (ls: no such file or directory) with managed mounts X-Mailer: VM 7.19 under Emacs 20.7.1 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Cygwin managed mounts give surprising (to me) results if a filename that's not in its canonical form manages to get below the managed mountpoint: $ mkdir managed unmanaged $ mount -o managed `cygpath -aw managed` $PWD/managed $ mkdir unmanaged/dir $ touch unmanaged/dir/Foo $ mv unmanaged/dir managed $ ls -l managed/dir ls: cannot access managed/dir/Foo: No such file or directory total 0 ?????????? ? ? ? ? ? Foo This is because path.cc's fnunmunge() leaves the Win32 filename "Foo" alone when it returns the directory entry for readdir(), but the corresponding fnmunge() transformation for stat() turns "Foo" into "%46oo", which doesn't exist in the directory. This problem appears to be known on the Internet, but was very puzzling to me until I figured out what was happening. Is there any reason why fnunmunge() shouldn't case-smash all non-quoted alphabetic characters in Win32 filenames to lower case? I.e., in this case, report the name of the file in managed/dir as "foo"? I believe this would ensure that the round-trip Win32->managed POSIX->Win32 file name transformation would always result in a valid Win32 name for the file. (I haven't been able to construct any other Win32 filenames that don't map to a valid managed-POSIX filename.) Is there a downside to this, other than an extra call to cyg_tolower in fnunmunge? -- Jonathan Lennox lennox at cs dot columbia dot edu -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/