delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/30/09:23:35

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Lloyd Zusman <ljz AT asfast DOT 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 DOT 20061029T225001-758 AT post DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 63 DOT 0610292309540 DOT 22731 AT access1 DOT cims DOT nyu DOT edu>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT asfast DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019