REBOL 3 Docs | Guide | Concepts | Functions | Datatypes | Errors |
TOC < Back Next > | Updated: 6-Feb-2009 Edit History |
When files are created by REBOL, default access permissions are set. On Windows and Macintosh systems files are created with full access privileges. On UNIX systems files are created with the permissions set to the current umask setting.
When using open or write to access a file the /allow refinement is used to set file access permissions.
The /allow refinement takes a block as an argument. This block can consist of any or all of the three words read, write and execute.
To make a file read only, use open/allow, or write/allow with a read block.
write/allow %file.txt [read]
To make a file readable and executable:
open/allow %file.txt [read execute]
You can set similar permissions for write access:
write/allow %file.txt [read write]
To prevent any access to a file (for operating systems where this would make a difference) provide an empty permissions block:
write/allow %file.txt []
To permit full access:
write/allow %file [read write execute]
TOC < Back Next > | REBOL.com - WIP Wiki | Feedback Admin |