[Gambas-user] Stat() Auth and Mode (misunderstanding or bug?)
Willy Raets
willy at ...2734...
Thu Sep 18 02:09:38 CEST 2014
On do, 2014-09-18 at 01:53 +0200, Benoît Minisini wrote:
> Le 18/09/2014 01:50, Willy Raets a écrit :
> > Hi all,
> >
> > Following was brought to my attention:
> >
> > To reproduce make a file named test in your home folder.
> > Create a console project in IDE with any name you like
> >
> > Public Sub Main()
> >
> > Dim sPath As String
> > sPath = User.Home &/ "test"
> > With Stat(sPath)
> > Print "Auth: " & .Auth
> > Print "Mode: " & .Mode
> > End With
> >
> > End
> >
> > Run the project.
> > Output is:
> >
> > Auth: rw-r--r--
> > Mode: 420
> >
> > Should mode not be 644 or do I misunderstand Stat().Mode?
> >
> > user rw- = 6
> > group r-- = 4
> > other r-- = 4
> >
>
> 644 is octal. In decimal it is 420.
That explains a lot and at the same time it is confusing as I got used
to octal representation when running chmod on linux.
I guess I'll have to rewire my brain when using Stat().Mode in Gambas :)
--
Kind regards,
Willy (aka gbWilly)
http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org
More information about the User
mailing list