This is the mail archive of the 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: How to "find" all writable files in a directory tree?


I was not providing the correct way to solve the original problem, I was
correcting Winston's statement that you needed a separate script.
Personally, I'd use the -perm invocation in this particular case...
P.S. Bug?  What bug? ;-)

On Fri, 9 May 2003, Randall R Schulz wrote:

> Igor,
> At 14:22 2003-05-09, Igor Pechtchanski wrote:
> >Winston,
> >
> >Most of this is off-topic, but why not simply
> >
> >find <dir> -type f -exec test -w {} \; -print
> >
> >?
> >Or, if you want something more complex,
> >
> >find <dir> -type f -exec sh -c "test -w {} && echo {}" \;
> It should be noted that the overhead of this will be pretty high,
> especially considering how little real work is being done in "-exec"
> task. If the number of files to examine is at all large, working out
> the correct self-contained find incantation is quite likely worth the
> cognitive effort.
> Also, on the offhand chance that there is a bug lurking somewhere here,
> it would be good to flush it out.
> Randall Schulz

      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II

Unsubscribe info:
Problem reports:

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