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 (Fri, 27 Oct 2006 11:49:51 +0000 (UTC))
> Thorsten Kampe <thorsten <at> thorstenkampe.de> writes:
> > * Lloyd Zusman (Thu, 26 Oct 2006 11:31:39 +0000 (UTC))
> > > Aside from using "cmd /c attrib", is there a way in cygwin for me to
> > > change the Windows "hidden" or "system" attributes of a file?
> > 
> > Yes, "attrib" (without the "cmd /c")
> 
> That doesn't work for me inside the cygwin bash shell on my box:
> 
>   ljz@nykdwm708345 ~
>   $ attrib
>   bash: attrib: command not found
> 
> I guess I have some sort of PATH or mount error, which I'll check after
> posting this message.

Should have done that /before/. It's in %systemroot%\win32.
 
> > > There don't seem to be any extensions to chmod that will accomplish
> > > this,
> > 
> > There is no concept of hidden or system as a file attribute in Linux. 
> > It's achieved via a leading dot in the file name...
> 
> I was mentioning _extensions_ to the chmod command, not the standard
> Linux syntax.  The cygwin ps command has the "-W, --windows" extension,
> and I was commenting on the fact that the cygwin chmod command doesn't
> have anything similar that might deal with Windows-specific file attributes.

You don't see the the structural difference. ps shows processes and 
with -W it still shows processes. chmod modifies or shows file 
permissions. Attributes like "system" or "hidden" are not related to 
file access rights.
 
> Furthermore, given that I'm running cygwin, the underlying OS is Windows,
> not Linux, and Windows indeed makes use of these "hidden" and "system" 
> attributes.  I'm sure that you realize that putting a dot in front of a
> file name on a Windows box will not magically cause that OS to suddenly
> treat the file as a hidden or system file.

That's correct but also a nonsensical tautology. I'm sure that you 
realize that setting the file attribute to hidden or system will not 
magically cause Cygwin (or more precisely: bash) to suddenly treat 
this file as system or hidden file.

The only attribute where there is a connection is "read only" which is 
interpreted as chmod 400.

> Since I couldn't get "attrib" to work by itself within my bash
> shell, I was wondering if there was a way under cygwin to change the
> Windows-specfic system or hidden file attributes without going into
> a "Command Prompt" (ugh!) or using Windows Explorer (more ugh!).

If you want to access an executable either specify the full path or 
adjust your path. This is not specific for Cygwin (not even for 
Windows or Linux or NetWare or Python or Java).
 
> > > and I'm wondering if there is a cygwin-specific utility that I might
> > > be able to use for this purpose.
> > 
> > Why should there be one?!
> 
> I never said that there "should" be one.  What gives you the idea that
> I was complaining about cygwin functionality?  I was simply asking
> whether there _might_ be such a cygwin-based utility.

I know that you weren't "complaining". Let me rephrase my question: 
why might there be such an utility?

> Cygwin offers the "-W, --windows" extension to ps and the regtool,
> getfacl, and setfacl commands (to name but three) which offer
> Windows-specific (i.e., non-Linux) capabilities.

I see your point regarding get/setfacl and regtool. As far as I know 
these offer a different approach and somewhat different functionality 
than cacls/xcacls and reg.exe. There's also a Cygwin ping.

The question is here: what could a Cygwin attrib do (or do 
differently) that the native attrib does not?

Thorsten


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


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