I'm trying to use setFilePermissions from the os module.
This function takes a set[FilePermission].
If I have a type like var perms: set[FilePermission], how do I gradually add new FilePermission types to it - e.g fpUserExec?
(I would expect something like a bitwise operator, but not sure if that's the case)
You include a set element via incl.
perms.incl fpUserExec
Yes, this is implemented by bitwise operators but Nim doesn't confuse the different layers of abstraction.
chmod "file.ext", 0o644
https://nim-lang.github.io/fusion/src/fusion/filepermissions.html#chmod%2Cstring%2CNatural
Perfect! Good that I asked then...
Thanks a lot!