delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/19/15:31:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <432F122A.ADF69285@dessent.net>
Date: Mon, 19 Sep 2005 12:31:54 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Bug: Setup tool doesn't respect managed mountpoints/filesystems
References: <0IN2009A5RCXL6 AT pmismtp01 DOT mcilink DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0509191358260 DOT 21521 AT slinky DOT cs DOT nyu DOT edu> <432F06FB DOT 7A5422B6 AT dessent DOT net> <Pine DOT GSO DOT 4 DOT 63 DOT 0509191502560 DOT 21521 AT slinky DOT cs DOT nyu DOT edu>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Igor Pechtchanski wrote:

> Yes, there are issues to work out here, but they are not very different
> from, say, those arising when two programs try creating a file with the
> same name simultaneously...  In fact, the case-insensitivity of both NTFS
> and VFAT plays into our hands here, as you say below: creating a new file
> that differs only in case will always fail, so Cygwin simply has to encode
> the file name if its creation failed.

It's still extra system calls that would slow things down.  And what if
you tried to open("readme") when README exists?  It would succeed (on
anything but NT with NTFS with Cygwin using the Native API), but on a
managed mount it's supposed to fail.

And what if "README" exists, and you want to create "readme"?  Okay, so
you have to encode "readme" as "%52%65%41%44%4d%65".  Now you delete
"README", leaving only "%52%65%41%44%4d%65".  A program tries to
open("readme") -- this fails when it should succeed.  Cygwin would have
to know to sometimes try "readme" and sometimes try "%52%65%41%44%4d%65"
when the program tries to open "readme", how would it know this without
looking at every file in the directory?  Repeat for "readme" vs.
"Readme" and every other of billions of permutation of case.  I see no
way this wouldn't turn into a nightmare.

Encoding every filename seems like a win-win situation to me.  The only
overhead is the string processing aspect of translating "a" into "%41". 
There are no added filesystem calls because every filename is turned
into a canonical unique filename.  If you let "readme" sometimes be
"readme" and sometimes be "%52%65%41%44%4d%65", all hell breaks loose.

Brian

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019