Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 12 Sep 2002 14:09:59 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Nicholas Wourms cc: cygwin AT cygwin DOT com, Paul Johnston Subject: Re: Release candidate 1: /etc/hosts In-Reply-To: <20020912174604.47836.qmail@web21007.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 12 Sep 2002, Nicholas Wourms wrote: > --- Igor Pechtchanski wrote: > > On Thu, 12 Sep 2002, Paul Johnston wrote: > > > > > Hi, > > > Thanks to Corinna, Joe, Nicholas, Warren and especially Igor, this > > > script should now be good enough. I've successfully tested it on XP > > > only. > > > > This works on Windows 98 (sort of): > > > > BASH-2.05b$ uname -a > > CYGWIN_98-4.10 FAETON 1.3.12(0.54/3/2) 2002-07-06 02:16 i686 > > unknown > > BASH-2.05b$ ./make-etc-links.sh > > create symbolic link `/etc/hosts' to `/cygdrive/c/WINDOWS/hosts' > > create symbolic link `/etc/protocols' to > > `/cygdrive/c/WINDOWS/protocol' > > create symbolic link `/etc/services' to > > `/cygdrive/c/WINDOWS/services' > > create symbolic link `/etc/networks' to > > `/cygdrive/c/WINDOWS/networks' > > BASH-2.05b$ > > > > However, two problems: > > > > 1) When the script has run, but created a link to a non-existent > > file, and then run again: > > > > BASH-2.05b$ ./make-etc-links.sh > > /bin/ln: `/etc/protocols': File exists > > BASH-2.05b$ ls /etc/protocols > > /etc/protocols > > BASH-2.05b$ [ ! -e /etc/protocols ]; echo $? > > 0 > > BASH-2.05b$ [ ! -L /etc/protocols ]; echo $? > > 1 > > BASH-2.05b$ > > > > The -e test apparently fails if the file is a symbolic link to a > > non-existent file (is this a bug?). I've attached the correction. > > > > 2) CYGWIN="check_case:strict" > > As I suspected earlier, this fails -- the links are created, but an > > attempt to cat the files results in "no such file or directory", > > and an attempt to save the file after editing results in a write > > error. On my Windows 98, cygwin interprets the filenames for > > c:\windows\hosts, etc, as all caps. I don't know how important this > > is to pursue. > > Why not just check for all the possible combinations [HOSTS, Hosts, > hosts]? I use check_case:strict on a daily basis. If you don't use > it, then you cannot compile gcj java programs at times. Also, you > cannot bootstrap gcc with java enabled. I think this is important > and heads of questions in the long run. Ahem, there are 32 possible combinations for hosts, and 256 for networks, services and protocols (windows only uses the first 8 letters). I realize that most of them are improbable, but for the script to be robust, it should be able to handle any of them. I also constantly use check_case:strict, which is why I raised the concern in the first place. On my 2k system, the following will return the exact case: 'cmd /c "dir /b "`cygpath -w $file`'... Can someone verify that this (with the appropriate correction of "cmd" to "command.com", of course) also works on 9x/ME systems? Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! It took the computational power of three Commodore 64s to fly to the moon. It takes a 486 to run Windows 95. Something is wrong here. -- SC sig file -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/