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: Tue, 31 Oct 2006 11:05:01 +0000 (UTC)
Lines: 40
Message-ID:  <loom.20061031T115838-413@post.gmane.org>
References:  <loom.20061026T132712-881@post.gmane.org> <ehqsbl$dpe$1@sea.gmane.org> <loom.20061027T131039-458@post.gmane.org> <eht7p9$ujt$1@sea.gmane.org> <loom.20061028T031119-796@post.gmane.org> <ei598o$hl3$1@sea.gmane.org>
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

Matthew Woehlke <mwoehlke <at> tibco.com> writes:
> 
> Lloyd Zusman wrote:
>
> > P.S. -- Here's my script.  I call it "cattrib" (I'm posting via gmane,
> > so forgive me if the indentation is screwed up):
> > [snip script]
> 
> You could probably make this even more transparent by dropping a symlink 
> 'attrib' to this somewhere high in $PATH (or renaming it, but the 
> symlink lets 'cattrib' force calling the script even if the Windows 
> 'attrib' is higher in PATH) and having the script call 'attrib.exe' 
> (which won't pick up the script).
> 
> Also, if you want it to be *really* transparent, you should be 'cut -c 
> 12-'ing the output of attrib and then appending the original arg before 
> its trip through cygpath, otherwise you potentially mangle things due to 
> symlinks, mount points, etc.
> 
> i.e. something like this:
> echo "$(attrib.exe $(cygpath -w "${arg}") | cut -c 12-)${arg}"

Yep.  These are all good suggestions.  The script as written was rightfully
named a "hack" because it wasn't robust in the ways you're suggesting.

The only thing I disagree with is symlinking it to "attrib", since this
might cause confusion to users other than me who expect that program to
work in the Windows-specific manner.  If I want the "attrib" name, I'd
rather just make that a bash or zsh alias.

Thank you very much.

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

