[fpc-pascal] the unexplained 666
robert.wolfe at robertwolfe.org
Sun Mar 1 14:54:35 CET 2015
From: fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] On Behalf Of Mattias
Sent: Sunday, March 1, 2015 7:52 AM
To: fpc-pascal at lists.freepascal.org
Subject: [fpc-pascal] the unexplained 666
Today I stumbled (again) over TFileStream and it contains the constant
constructor TFileStream.Create(const AFileName: string; Mode: Word);
You need several searches to find out what the 438 actually is.
For example its fpdoc page does not explains it:
Same for the called FileCreate:
Under Windows the Rights are not used.
Under Unix it calls fpOpen, which only tells about "permissions":
Then it calls 'FPC_SYSC_OPEN', which under Linux calls syscall 'open', which
after a search reveals, that the mode is a bit field using the
S_I* constants, which are usually written in binary, octal or hexadecimal.
The octal value of 438 is &666, which is read/write permissions for
Why not write &666? Maybe some religious reasons? ;)
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal