This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: if [ -w branching: how to spot a locked USB stick


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>

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
-r--r--r-- 1 fergus q.1.7    4829 Feb 16 07:00 amy.d
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
~> if [ -w sc/l/gn ] ; then echo +W ; else echo -W ; fi

Is this something that could receive attention? (Hope I haven't somehow got things wrong myself.)
Thank you,

-- Problem reports: FAQ: Documentation: Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]