[Gambas-user] An utility component for Gambas
T Lee Davidson
t.lee.davidson at ...626...
Mon Dec 1 23:22:27 CET 2014
On 12/01/2014 03:47 PM, Benoît Minisini wrote:
> Le 01/12/2014 21:37, Tobias Boege a écrit :
>> On Mon, 01 Dec 2014, T Lee Davidson wrote:
>>> On 12/01/2014 02:35 PM, Beno??t Minisini wrote:
>>>> Maybe an Oct$() function inside the interpreter. Octal is normally not
>>>> needed with Gambas. Do you have any use of that?
>>>
>>> Perhaps only occasional use, but, yes. Stat.Mode returns the mode of a
>>> file as a decimal integer which is not very intuitive for someone used
>>> to working with CHMOD with octal numbers. Oct$(420) --> 644
>>>
>>
>> Stat.Mode is an Integer. An integer is a value. There is no such thing as
>> a "decimal integer". It may be *stored* in a binary base in memory, it may
>> be *displayed* in decimal base if you Print it, but per se it doesn't have
>> any base attached to it. You only give an integer a base if you encode it
>> to a string.
>>
>
> Moreover, you can use Stat.Auth that decodes the authorization into a
> "chmod-like" string. No need to deal with integer in any base. :-)
Well yes, that's true. But, as you said, Stat.Auth represents the mode
as a string in the form "rw-r--r--", not as a number. Not a real big
deal, hence why I said, "Perhaps only occasional use."
--
Lee
__________
"Artificial Intelligence is no match for natural stupidity."
More information about the User
mailing list