Simple find command does not work for * .html

Eric Blake ericblake@comcast.net
Fri Sep 9 01:48:00 GMT 2005


http://cygwin.com/acronyms/#TOFU - reformatted

> >From: ericblake AT comcast.net (Eric Blake)
> >To: Matthew Movafaghi <mattmova AT hotmail.com>, cygwin AT cygwin.com

http://cygwin.com/acronyms/#PCYMTNQREAIYR

> > > `find d:\ -type f -perm -u+w -name *.properties`
> It was user error... of course.  Thanks for the fix.
> 
> I was just trying to find all writiable files of certain types.
> 
> 
> However, the command
> 'find /cygdrive/d -type f -perm -u+w -name \*.html' will sometimes not find 
> a writable file when windows thinks that it is.  When viewed with ls -l, the 
> file doe not look writable, but when viewed with dir *.html /A-r /S from a 
> cmd prompt the file shows up.
> 
> Any thoughts?

Windows permissions and POSIX permissions don't always match.
POSIX permissions map the 9 POSIX bits with ACLs onto windows
access rights, not the more archaic read-only attribute, whereas the
/A switch to DOS's dir looks at the read-only attribute (be aware that
there is also a cygwin dir, which is a thin wrapper around ls, and which
doesn't like DOS syntax - be careful what you are using).  And there
is also the question of whether the ACLs give different permissions to
multiple owners or groups, something that basic POSIX permissions do
not handle very well, but which getfacl does do.  Read up on
http://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-perm and
http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-common.  If ls -l
does not show a file as writeable, then find -perm u+w will not either.

--
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list