This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: if [ -w branching: how to spot a locked USB stick
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 9 Mar 2011 12:38:51 +0100
- Subject: Re: if [ -w branching: how to spot a locked USB stick
- References: <4D776051.6040303@bonhard.uklinux.net>
- Reply-to: cygwin at cygwin dot com
On Mar 9 11:11, Fergus wrote:
> >> 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 <Enter>
> 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.)
First of all, this is something entirely different from what you were
asking in your OP.
Second, keep in mind that the R/O attribute on directories does not
indicate a read-only directory, therefore it's ignored by Cygwin as
well. See http://support.microsoft.com/kb/326549.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
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