X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Lloyd Zusman <ljz@asfast.com>
Subject:  Re: Changing Windows "hidden" and "system" attributes?
Date: Mon, 30 Oct 2006 14:16:15 +0000 (UTC)
Lines: 48
Message-ID:  <loom.20061030T150415-999@post.gmane.org>
References:  <loom.20061029T225001-758@post.gmane.org> <Pine.GSO.4.63.0610292309540.22731@access1.cims.nyu.edu>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

