X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Lloyd Zusman Subject: Re: Changing Windows "hidden" and "system" attributes? Date: Mon, 30 Oct 2006 14:16:15 +0000 (UTC) Lines: 48 Message-ID: References: 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 AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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/