How to set file permission programmatically? I've created a compiler lazarus / 66-Unix ---------------------------------------------------------------------- Mussel · 2021-07-28 13:20 Hi, I have written a simple back-end compiler for Linux x64 using Pascal which supports two commands only: ReadLine and WriteLine. Now the issue is after my compiler generating the ELF64 binary program, I do not know how to set the file permission so that it can be allowed to execute. In the mean time, I have to set each one manually: Code: [Select]chmod u=rwx,g=rx,o=rx test BTW, if anyone is interested, can try this back-end compiler, open- source. ELF64 binary file format is quite simple if used with only sys_read and sys_write. https://github.com/khanming/Pipit ---------------------------------------------------------------------- marcov · 2021-07-28 13:23 If you had searched on chmod in the manuals, you would have found: https://www.freepascal.org/docs-html/rtl/baseunix/fpchmod.html