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?

Lloyd Zusman wrote:
Thorsten Kampe <thorsten <at>> writes:
Yes, I know that I could put a wrapper script around attrib to apply
cygpath to the argument, to name but one of several ways to solve this.
In fact, I have already done this, thereby making my own cygwin-compliant
analog to attrib.

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}"

This message will self destruct in ten centuries.

-- Unsubscribe info: Problem reports: Documentation: FAQ:

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