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

2011-03-09 Thread Corinna Vinschen
On Mar 9 12:38, Corinna Vinschen wrote: > 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

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

2011-03-09 Thread Corinna Vinschen
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 > Q:\home\user\sc\l\gn > Q:\home\user\sc\d\

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

2011-03-09 Thread Fergus
I meant to say ~> # ... but gn shows up as drwx not d-wx NOT SO GOOD dr-x Fergus -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygw

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

2011-03-09 Thread Fergus
>> 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 o

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

2011-03-09 Thread Corinna Vinschen
On Mar 9 10:02, Fergus wrote: > In 2007: > http://cygwin.com/ml/cygwin/2007-07/msg00313.html > > It turned out to be a Windows issue, not bash or Cygwin: > http://cygwin.com/ml/cygwin/2007-07/msg00324.html > > Corinna dug into the issue: > http://cygwin.com/ml/cygwin/2007-07/msg00335.html > > I

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

2011-03-09 Thread Fergus
In 2007: http://cygwin.com/ml/cygwin/2007-07/msg00313.html It turned out to be a Windows issue, not bash or Cygwin: http://cygwin.com/ml/cygwin/2007-07/msg00324.html Corinna dug into the issue: http://cygwin.com/ml/cygwin/2007-07/msg00335.html I'm sorry, I don't have a lockable USB stick to han

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

2007-09-20 Thread Fergus
A couple of months ago http://www.cygwin.com/ml/cygwin/2007-07/msg00313.html I wondered whether a user could use "if [ -w " branching in Cygwin to distinguish a locked stick from an unlocked stick. Apparently the answer was No but Corinna identified an easy fix http://www.cygwin.com/ml/c

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

2007-07-13 Thread fergus
> Actually I found that there's a laughable simple way to > determine a read-only device. When calling > GetVolumeInformation, the FILE_READ_ONLY_VOLUME flag is > set. I just tested this with a USB stick. Since we have > the information from fs_info anyway, a fix should be very > simple and not

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

2007-07-13 Thread Corinna Vinschen
On Jul 13 10:27, Christopher Faylor wrote: > On Fri, Jul 13, 2007 at 04:15:26PM +0200, Corinna Vinschen wrote: > >On Jul 13 08:00, Eric Blake wrote: > >> According to Corinna Vinschen on 7/13/2007 7:06 AM: > >> >> Actually, this is a cygwin question. Bash's [ command only reports what > >> >> acce

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

2007-07-13 Thread Larry Hall (Cygwin)
Christopher Faylor wrote: On Fri, Jul 13, 2007 at 04:15:26PM +0200, Corinna Vinschen wrote: On Jul 13 08:00, Eric Blake wrote: According to Corinna Vinschen on 7/13/2007 7:06 AM: Actually, this is a cygwin question. Bash's [ command only reports what access("/h",W_OK) tells it to report, It

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

2007-07-13 Thread Christopher Faylor
On Fri, Jul 13, 2007 at 04:15:26PM +0200, Corinna Vinschen wrote: >On Jul 13 08:00, Eric Blake wrote: >> According to Corinna Vinschen on 7/13/2007 7:06 AM: >> >> Actually, this is a cygwin question. Bash's [ command only reports what >> >> access("/h",W_OK) tells it to report, >> > >> > It's th

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

2007-07-13 Thread Corinna Vinschen
On Jul 13 08:00, Eric Blake wrote: > According to Corinna Vinschen on 7/13/2007 7:06 AM: > >> Actually, this is a cygwin question. Bash's [ command only reports what > >> access("/h",W_OK) tells it to report, > > > > It's the latter. The fact that the USB stick is locked doesn't > > mean that t

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

2007-07-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Corinna Vinschen on 7/13/2007 7:06 AM: >> Actually, this is a cygwin question. Bash's [ command only reports what >> access("/h",W_OK) tells it to report, > > It's the latter. The fact that the USB stick is locked doesn't > mean that t

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

2007-07-13 Thread Corinna Vinschen
On Jul 13 06:45, Eric Blake wrote: > According to fergus on 7/13/2007 12:03 AM: > > if [ -w /h ] ; then echo +W ; else echo -W ; fi > > > > tests a device located at /h (or /cygdrive/h) for write-ability: eg a > > USB memory stick will echo +W and a CD will echo -W. If the stick is > > locked

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

2007-07-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to fergus on 7/13/2007 12:03 AM: > This question isn't strictly Cygwin, but I hope it's OK to ask it in the > context of Cygwin on a portable device eg a CD or a usb mobile drive or > memory stick: the bash command > > if [ -w /h ] ; the

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

2007-07-12 Thread fergus
This question isn't strictly Cygwin, but I hope it's OK to ask it in the context of Cygwin on a portable device eg a CD or a usb mobile drive or memory stick: the bash command if [ -w /h ] ; then echo +W ; else echo -W ; fi tests a device located at /h (or /cygdrive/h) for write-abili