Set file permissions

Verified
Added by iNTERFACEWARE

Use os.fs.chmod() to set file permissions, using octal mode (symbolic mode does not work)

Source Code
   -- grant full access using octal "777" or "0777"
   os.fs.chmod('temp', '777') 
   os.fs.chmod('temp', '0777')
   
   -- symbolic mode does not work - fails and raises an error
   os.fs.chmod('temp', '-rwxrwxrwx')
Description
Use os.fs.chmod() to set file permissions, using octal mode (symbolic mode does not work)
Usage Details

Use os.fs.chmod() to file permissions, using octal mode, f you try to use symbolic it will raise an error. This is the Linux/Unix command (change mode) for setting file permissions.

How to use the snippet:

  • Paste the desired permission code into your script

Note: For more information see: chmod on wikipedia