[Gambas-user] An utility component for Gambas

Benoît Minisini gambas at ...1...
Mon Dec 1 21:47:27 CET 2014


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

-- 
Benoît Minisini




More information about the User mailing list