Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2025-12

Default value for "Rights" in TFileStream.Create

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

Just wondering.
If you call TFileStream.Create(aFileName, aFileMode) it calls TFileStream.Create(aFileName, aFileMode, 438).
438 (octal 666) tramslates to -rw-rw-rw-

If I create a file on my linux machine (using touch or cat) then rights will be -rw-rw-r--, which is equivalent to octal 664 (decimal 436).

So, that just made me wonder why the choice for octal 666? Notice that I'm a linux novice.

(For laughs. I accidentally used 0 for the rights param somewhere. That turned out te be quite funny.)

Bart

Reply by email

Michael Van Canneyt
to Bart
Bart wrote 10 lines
Hi, Just wondering. If you call TFileStream.Create(aFileName, aFileMode) it calls TFileStream.Create(aFileName, aFileMode, 438). 438 (octal 666) tramslates to -rw-rw-rw- If I create a file on my linux machine (using touch or cat) then rights will be -rw-rw-r--, which is equivalent to octal 664 (decimal 436).

It actually depends on the setting of umask:

https://askubuntu.com/questions/44542/what-is-umask-and-how-does-it-work

So, that just made me wonder why the choice for octal 666? Notice that I'm a linux novice.

As you see in the page above, the default is 666.

Michael.

Reply by email