public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* chmod questions
@ 2013-08-07 18:33 Drew Adams
  2013-08-07 18:48 ` Larry Hall (Cygwin)
  2013-08-07 18:49 ` J. David Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Drew Adams @ 2013-08-07 18:33 UTC (permalink / raw)
  To: cygwin

I have read various info regarding trying to make Cygwin's `chmod'
work as (I) expected, including the Cygwin FAQ and user guide.
I am using Windows 7 with an NTFS disk.  My user and group are
defined as they should be AFAIK.

Two questions in this regard:

 . is "chmod a-w" supposed to set the Windows Read-only attribute
   on Windows 7?

 . is "chmod a-w" supposed to cause "ls -l" to show -r-r-r on
   Windows 7?

When I do `chmod a-w' it does not seem to have any effect.  The
target file is still writable.  Can someone please tell me what
I'm missing?  Thx.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chmod questions
  2013-08-07 18:33 chmod questions Drew Adams
@ 2013-08-07 18:48 ` Larry Hall (Cygwin)
  2013-08-07 18:49 ` J. David Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Hall (Cygwin) @ 2013-08-07 18:48 UTC (permalink / raw)
  To: cygwin

On 8/7/2013 2:33 PM, Drew Adams wrote:
> I have read various info regarding trying to make Cygwin's `chmod'
> work as (I) expected, including the Cygwin FAQ and user guide.
> I am using Windows 7 with an NTFS disk.  My user and group are
> defined as they should be AFAIK.
>
> Two questions in this regard:
>
>   . is "chmod a-w" supposed to set the Windows Read-only attribute
>     on Windows 7?

No.

>   . is "chmod a-w" supposed to cause "ls -l" to show -r-r-r on
>     Windows 7?

Not exactly.  More precisely, it will remove the write permissions for
all.

> When I do `chmod a-w' it does not seem to have any effect.  The
> target file is still writable.  Can someone please tell me what
> I'm missing?  Thx.

I'm assuming that you're not using the exact syntax that you have
above.  This works for me:


$ ls -l
total 23302
-rwxr-xr-x  1 lhall None    72393 Jun 17 12:46 a.exe*
-rw-r--r--  1 lhall None       84 Jun 17 12:45 helloworld.c
-rw-r--r--  1 lhall None      587 Jun 17 12:45 helloworld.o

$ attrib
A            C:\tmp\junk\a.exe
A            C:\tmp\junk\helloworld.c
A            C:\tmp\junk\helloworld.o

$ chmod -w *

$ ls -l
total 23302
-r-xr-xr-x  1 lhall None    72393 Jun 17 12:46 a.exe*
-r--r--r--  1 lhall None       84 Jun 17 12:45 helloworld.c
-r--r--r--  1 lhall None      587 Jun 17 12:45 helloworld.o

$ attrib
A            C:\tmp\junk\a.exe
A            C:\tmp\junk\helloworld.c
A            C:\tmp\junk\helloworld.o

Of course, whatever your umask setting is comes into play as well.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: chmod questions
  2013-08-07 18:33 chmod questions Drew Adams
  2013-08-07 18:48 ` Larry Hall (Cygwin)
@ 2013-08-07 18:49 ` J. David Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: J. David Boyd @ 2013-08-07 18:49 UTC (permalink / raw)
  To: cygwin

Drew Adams <drew.adams@oracle.com> writes:

> I have read various info regarding trying to make Cygwin's `chmod'
> work as (I) expected, including the Cygwin FAQ and user guide.
> I am using Windows 7 with an NTFS disk.  My user and group are
> defined as they should be AFAIK.
>
> Two questions in this regard:
>
>  . is "chmod a-w" supposed to set the Windows Read-only attribute
>    on Windows 7?
>
>  . is "chmod a-w" supposed to cause "ls -l" to show -r-r-r on
>    Windows 7?
>
> When I do `chmod a-w' it does not seem to have any effect.  The
> target file is still writable.  Can someone please tell me what
> I'm missing?  Thx.

Works for me.

Here's a file on my system:

$ ls -ltr boxes.txt
-rw-rw-rw-+ 1 A4J0PZZ Administrators 45 Aug  5 12:46 boxes.txt


When I run chmod a-w boxes.txt, I get

$ ls -ltr boxes.txt
-r--r--r--+ 1 A4J0PZZ Administrators 45 Aug  5 12:46 boxes.txt

and the file is no longer writeable.

That's not what you are seeing?  I'm on Windows 7 with an NTFS disk as well.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-07 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07 18:33 chmod questions Drew Adams
2013-08-07 18:48 ` Larry Hall (Cygwin)
2013-08-07 18:49 ` J. David Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).