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: Changing Windows "hidden" and "system" attributes?


Igor Peshansky <pechtcha <at> cs.nyu.edu> writes:
> 
> On Sun, 29 Oct 2006, Lloyd Zusman wrote:
>
> > [ ... ]
> >
> > Because of cygpath, filenames such as .elinks/bookmarks and
> > .fluxbox/fbrun_history are passed to xargs like this:
> > .elinks\bookmarks and .fluxbox\fbrun_history.
> >
> > [ ... ]
> 
> Indeed.  So how about using the "-m" option of cygpath, instead of the
> "-w"?  FWICS, attrib will happily understand "/"-delimited filenames.

Yes, that seems to work fine.  I forgot about -m.  Thanks.


> > Because of this, a hacky wrapper script for attrib like the
> > one I wrote in my earlier message is still needed, unfortunately.
> 
> I had no problem running your test with "cygpath -m".

It indeed works in the case I mentioned above.  However, it gets more
complicated for cases like this:

  find . -type f | cygpath -m -f- | xargs -L1 attrib | something

... where "something" is some other cygwin command which processes some
or all of the resulting file names.  I still like my wrapper-script hack,
because it accepts cygwin paths on input and puts cygwin paths into
its output.  This allows the output to be easily manipulated by other
cygwin utilities.  Also, it permits us to dispense with the -L1 option
to xargs, thereby minimizing the number of times a subshell is forked
as a directory tree is traversed:

  find . -type f | xargs cattrib | something

... where "cattrib" is my hacky script.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.






--
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/


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