help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mismatch between what Emacs considers read-only and file permissions


From: Will Parsons
Subject: Re: mismatch between what Emacs considers read-only and file permissions
Date: 4 Feb 2015 19:53:33 GMT
User-agent: slrn/1.0.2 (FreeBSD)

Eli Zaretskii wrote:
>> From: Will Parsons <address@hidden>
>> Date: 4 Feb 2015 17:12:52 GMT
>> 
>> How does Emacs determine whether to mark a buffer read-only when
>> visiting a file that is writable?
>
> By looking at the file permission bits.
>
>> 1) Under Windows
>> 
>> I make heavy use of the Cygwin environment under Windows, but usually
>> use the native Windows Emacs.  I've never bothered to track down the
>> exact circumstances, but assume that Cygwin is setting file
>> permissions in a way that confuses native Emacs.
>
> Cygwin attempts to emulate Posix user/group/other permission bits by
> manipulating Windows NT security attributes.  The way it does that
> will only work as you'd expect when those attributes are tested by
> Cygwin programs. Native Windows build of Emacs, OTOH, not only doesn't
> support the Cygwin fiddling with the NTSec features, it doesn't even
> look at those attributes when it checks files for accessibility;
> instead, it probes only the read-only bit (which is not affected by
> NTSec).
>
> My advice is not to mix Cygwin programs with native Emacs on Windows.
> Good native ports of Unix and GNU software to Windows are available,
> and you are advised to use them instead, if you don't want to deal
> with these incompatibilities.

I've been using Cywin for over a decade and find it far too useful to
live without.  As I had stated, I'm perfectly happy to deal the
incompatibilities simply by changing the read-only attribute on the
buffer when needed.

My real question is the second circumstance, where a file with the
Unix write bit set is marked read-only by Emacs.  Since it only occurs
when I log in directly as root in console mode (which I don't do that
often), I can live with that too, using the same method.  By *why*
does it happen?

-- 
Will


reply via email to

[Prev in Thread] Current Thread [Next in Thread]