[Gambas-user] File mode syntax

Rolf-Werner Eilert eilert-sprachen at ...221...
Thu Feb 4 15:34:56 CET 2016


Am 04.02.2016 14:59, schrieb Tobias Boege:
> On Thu, 04 Feb 2016, Rolf-Werner Eilert wrote:
>> Hi folks, I stumbled over this one:
>>
>> The help page about File Mode Syntax (for Chmod and Chgrp) says that
>> file mode has to be a string with 9 characters. The table lists them.
>>
>> I can leave out or taint random positions by unknown characters... but
>> it does not say which of the given characters are interpreted if I leave
>> out some of them.
>>
>> If I write "rwx", is this 1,2,3 (user)? And "rwx...r--" or "rwx###r--"
>> would mean "rwx for user, no change in group, and read-only for others?
>>
>> And I cannot simply set "660", right?
>>
>> Thanks for your insight...
>>
> I can't tell you what is the intended behaviour but the attached project
> shows that:
>
>    - "rwx" alone sets the owner bits, i.e. the first block,
>    - "r+-*/x--" sets owner's "r" and group's "x" and leaves owner's "w" and
>      group's "r" unchanged (the "+" and "/" characters) and resets everything
>      else because these have a "-",
>    - "rrr" only sets the owner's "r",
>    - octal modes such as "660" do not work.
>
> Included is also a function which converts a string of three octals into the
> Chmod mode syntax.
>
> Regards,
> Tobi
>
>

Ah, thank you very much, Tobias, that will help!

Regards
Rolf





More information about the User mailing list