temp_ssl_incluse.setFilePermisisons(700)
chmod "file.ext", 0o700
setFilePermission takes a filename and a set[FilePermission.
FilePermission is an enum defined here .
The chapter for set is in the manual .
On Linux, you can test it easily :
Create a file :
$ touch myfile.txt
Check permission :
$ ls -l `` => ``-rw-r--r-- 1 users users 0 Feb 8 12:14 myfile.txt
This just writes a file called test.nim with the testPersionn snippet :
$ $ cat > test.nim << EOF
import os
setFilePermissions("myfile.txt", {fpUserWrite, fpUserRead, fpUserExec})
EOF
Compile & run :
$ nim r test.nim
New permission : User can read, write, execute. Group has nothing (which is correspond to what we set):
$ ls -l `` => ``-rwx------ 1 users users 0 Feb 8 12:14 myfile.txt