unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set-file-modes on w32
@ 2009-10-14 16:03 Lennart Borgman
  2009-10-14 16:32 ` Juanma Barranquero
  2009-10-14 16:35 ` Davis Herring
  0 siblings, 2 replies; 11+ messages in thread
From: Lennart Borgman @ 2009-10-14 16:03 UTC (permalink / raw)
  To: Emacs-Devel devel

What does set-file-modes do on for example w32?




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

* Re: set-file-modes on w32
  2009-10-14 16:03 set-file-modes on w32 Lennart Borgman
@ 2009-10-14 16:32 ` Juanma Barranquero
  2009-10-14 16:37   ` Lennart Borgman
  2009-10-14 16:35 ` Davis Herring
  1 sibling, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2009-10-14 16:32 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

> What does set-file-modes do on for example w32?

Fset_file_modes calls `chmod':

  if (chmod (SDATA (encoded_absname), XINT (mode)) < 0)

chmod, via src/s/ms-w32.h (included in src/config.h) is defined as

  #undef chmod
  #define chmod   sys_chmod

sys_chmod is defined in w32.c,

  int
  sys_chmod (const char * path, int mode)
  {
    return _chmod (map_w32_filename (path, NULL), mode);
  }

and _chmod, not surprisingly, "[c]hange[s] the file-permission settings":

  http://msdn.microsoft.com/en-us/library/1z319a54%28VS.71%29.aspx

    Juanma




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

* Re: set-file-modes on w32
  2009-10-14 16:03 set-file-modes on w32 Lennart Borgman
  2009-10-14 16:32 ` Juanma Barranquero
@ 2009-10-14 16:35 ` Davis Herring
  2009-10-14 16:39   ` Lennart Borgman
  1 sibling, 1 reply; 11+ messages in thread
From: Davis Herring @ 2009-10-14 16:35 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

> What does set-file-modes do on for example w32?

Not much: W32 file systems tend to have very few mode bits (although NTFS
supports ACLs): they are Archive, Read Only, Hidden, and System.  I think
that `set-file-modes' only affects R.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




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

* Re: set-file-modes on w32
  2009-10-14 16:32 ` Juanma Barranquero
@ 2009-10-14 16:37   ` Lennart Borgman
  2009-10-14 16:38     ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2009-10-14 16:37 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Emacs-Devel devel

On Wed, Oct 14, 2009 at 6:32 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
>> What does set-file-modes do on for example w32?
>
> Fset_file_modes calls `chmod':
>
>  if (chmod (SDATA (encoded_absname), XINT (mode)) < 0)
>
> chmod, via src/s/ms-w32.h (included in src/config.h) is defined as
>
>  #undef chmod
>  #define chmod   sys_chmod
>
> sys_chmod is defined in w32.c,
>
>  int
>  sys_chmod (const char * path, int mode)
>  {
>    return _chmod (map_w32_filename (path, NULL), mode);
>  }
>
> and _chmod, not surprisingly, "[c]hange[s] the file-permission settings":
>
>  http://msdn.microsoft.com/en-us/library/1z319a54%28VS.71%29.aspx


Thanks Juanma, but does the MODE parameter to set-file-modes have the
same meaning as on *nix?




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

* Re: set-file-modes on w32
  2009-10-14 16:37   ` Lennart Borgman
@ 2009-10-14 16:38     ` Juanma Barranquero
  0 siblings, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2009-10-14 16:38 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

On Wed, Oct 14, 2009 at 18:37, Lennart Borgman
<lennart.borgman@gmail.com> wrote:

> Thanks Juanma, but does the MODE parameter to set-file-modes have the
> same meaning as on *nix?

Take a look at the MSDN reference and decide by yourself.

    Juanma




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

* Re: set-file-modes on w32
  2009-10-14 16:35 ` Davis Herring
@ 2009-10-14 16:39   ` Lennart Borgman
  2009-10-14 16:57     ` Juanma Barranquero
  2009-10-14 18:19     ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Lennart Borgman @ 2009-10-14 16:39 UTC (permalink / raw)
  To: herring; +Cc: Emacs-Devel devel

On Wed, Oct 14, 2009 at 6:35 PM, Davis Herring <herring@lanl.gov> wrote:
>> What does set-file-modes do on for example w32?
>
> Not much: W32 file systems tend to have very few mode bits (although NTFS
> supports ACLs): they are Archive, Read Only, Hidden, and System.  I think
> that `set-file-modes' only affects R.

Thanks, that was what I expected.

But should not set-file-modes doc string reflect this in some way?
Maybe a link to an explanation in Info?




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

* Re: set-file-modes on w32
  2009-10-14 16:39   ` Lennart Borgman
@ 2009-10-14 16:57     ` Juanma Barranquero
  2009-10-14 17:06       ` Lennart Borgman
  2009-10-14 18:19     ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2009-10-14 16:57 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

On Wed, Oct 14, 2009 at 18:39, Lennart Borgman
<lennart.borgman@gmail.com> wrote:

> Thanks, that was what I expected.

Then, why did you ask "what does set-file-modes do", instead of how
portable the MODE argument is between architectures and operating
systems?

    Juanma




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

* Re: set-file-modes on w32
  2009-10-14 16:57     ` Juanma Barranquero
@ 2009-10-14 17:06       ` Lennart Borgman
  0 siblings, 0 replies; 11+ messages in thread
From: Lennart Borgman @ 2009-10-14 17:06 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Emacs-Devel devel

On Wed, Oct 14, 2009 at 6:57 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Wed, Oct 14, 2009 at 18:39, Lennart Borgman
> <lennart.borgman@gmail.com> wrote:
>
>> Thanks, that was what I expected.
>
> Then, why did you ask "what does set-file-modes do", instead of how
> portable the MODE argument is between architectures and operating
> systems?


Sorry, it is just my way of asking. I should learn but...

I thought it would be clear what I meant. And it looked to me from
your answer that you thought I asked about that.




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

* Re: set-file-modes on w32
  2009-10-14 16:39   ` Lennart Borgman
  2009-10-14 16:57     ` Juanma Barranquero
@ 2009-10-14 18:19     ` Eli Zaretskii
  2009-10-14 22:18       ` Lennart Borgman
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2009-10-14 18:19 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Wed, 14 Oct 2009 18:39:19 +0200
> Cc: Emacs-Devel devel <emacs-devel@gnu.org>
> 
> > Not much: W32 file systems tend to have very few mode bits (although NTFS
> > supports ACLs): they are Archive, Read Only, Hidden, and System.  I think
> > that `set-file-modes' only affects R.
> 
> Thanks, that was what I expected.
> 
> But should not set-file-modes doc string reflect this in some way?

set-file-modes does on Windows what it meaningfully can.  Some day, a
more thorough implementation based on native Windows file security
might do the same it does on Windows.  I don't think users should
bother about these differences in implementation.





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

* Re: set-file-modes on w32
  2009-10-14 18:19     ` Eli Zaretskii
@ 2009-10-14 22:18       ` Lennart Borgman
  2009-10-15  4:06         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2009-10-14 22:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Wed, Oct 14, 2009 at 8:19 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Lennart Borgman <lennart.borgman@gmail.com>
>> Date: Wed, 14 Oct 2009 18:39:19 +0200
>> Cc: Emacs-Devel devel <emacs-devel@gnu.org>
>>
>> > Not much: W32 file systems tend to have very few mode bits (although NTFS
>> > supports ACLs): they are Archive, Read Only, Hidden, and System.  I think
>> > that `set-file-modes' only affects R.
>>
>> Thanks, that was what I expected.
>>
>> But should not set-file-modes doc string reflect this in some way?
>
> set-file-modes does on Windows what it meaningfully can.  Some day, a
> more thorough implementation based on native Windows file security
> might do the same it does on Windows.  I don't think users should
> bother about these differences in implementation.

Why not? What happens today if the user tries to do something that is
not supported?




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

* Re: set-file-modes on w32
  2009-10-14 22:18       ` Lennart Borgman
@ 2009-10-15  4:06         ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2009-10-15  4:06 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Thu, 15 Oct 2009 00:18:38 +0200
> Cc: herring@lanl.gov, emacs-devel@gnu.org
> 
> Why not? What happens today if the user tries to do something that is
> not supported?

Nothing.




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

end of thread, other threads:[~2009-10-15  4:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-14 16:03 set-file-modes on w32 Lennart Borgman
2009-10-14 16:32 ` Juanma Barranquero
2009-10-14 16:37   ` Lennart Borgman
2009-10-14 16:38     ` Juanma Barranquero
2009-10-14 16:35 ` Davis Herring
2009-10-14 16:39   ` Lennart Borgman
2009-10-14 16:57     ` Juanma Barranquero
2009-10-14 17:06       ` Lennart Borgman
2009-10-14 18:19     ` Eli Zaretskii
2009-10-14 22:18       ` Lennart Borgman
2009-10-15  4:06         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).