X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_RW,TW_WX X-Spam-Check-By: sourceware.org Message-ID: <4D776051.6040303@bonhard.uklinux.net> Date: Wed, 09 Mar 2011 11:11:13 +0000 From: Fergus User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Cygwin ML CC: Fergus Subject: Re: if [ -w branching: how to spot a locked USB stick Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 >> http://cygwin.com/ml/cygwin-cvs/2007-q3/msg00035.html Thanks, Corinna, amazingly helpful and prompt (and concise) as usual. However: here is an excerpt from a DOS command prompt: Q:\home\user>dir /ar /s /b Q:\home\user\sc\l\gn Q:\home\user\sc\d\amy.d In other words, under $HOME, there is one read-only folder ~/sc/l/gn/ and one read-only file ~/sc/l/d/amy.d. However, ls -al exhibits this attribute only for the file and not the folder: ~> # NB In what follows ... ~> # ... amy.d shows up as -r-- not -rw- GOOD ... ~> # ... but gn shows up as drwx not d-wx NOT SO GOOD ~> ls -alR sc ... sc/d: ... -r--r--r-- 1 fergus q.1.7 4829 Feb 16 07:00 amy.d ... sc/l: drwxr-xr-x 1 fergus q.1.7 0 Mar 8 14:56 gn/ ... and if [ -w ... also gets things wrong: ~> if [ -w sc/d/amy.d ] ; then echo +W ; else echo -W ; fi -W ~> if [ -w sc/l/gn ] ; then echo +W ; else echo -W ; fi +W Is this something that could receive attention? (Hope I haven't somehow got things wrong myself.) Thank you, Fergus -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple