Library: File system utilities (OMVFS legacy)
define external function vfsChangePermissions value string path to value integer mode modifying value integer mask (optional) contents value switch contents (optional) or define external function vfsChangePermissions value string filename-URL on value vfsDir dir to value integer mode modifying value integer mask (optional) contents value switch contents (optional)
Use vfsChangePermissions to set or alter the permissions of a file or directory.
You must include the following line at the beginning of your OmniMark program:
The vfsDir object dir must:
The following constants are usable for the mode and mask parameters. Multiple attributes can be set at once by creating a union.
If any of VFS-ATTR-USER-WRITE, VFS-ATTR-GROUP-WRITE and VFS-ATTR-OTHER-WRITE is set on Windows, then they are all set due to OS limitations.
Some UNIX systems do not allow non-root users to set VFS-ATTR-STICKY.
Attributes not supported by a particular OS will be ignored.
If mask is not specified, then the target's permissions are changed to match those specified in mode.
If mask is specified, then only the permissions specified in the mask will be modified to the matching values in mode.
If contents is set to VFS-INCLUDED and the target is a directory, then the directory along with its contents will be changed recursively to the specified permissions.
External exception VFS300 is thrown for any general OS operation failure. The text accompanying the exception will contain details on the reason for the failure.
External exception VFS111 is thrown if an URL supplied as a parameter to this function contains invalid encoding.
External exception VFS004 is thrown if the URL exceeds system length limits.
For complete details on absolute URLs and valid encoding, see Internet Standards RFC 1738: Uniform Resource Locators.
For complete details on relative URLs, see Internet Standards RFC 1808: Relative Uniform Resource Locators.
Set the file "myfile.txt" to be readable by everybody, but only writable by its owner and other group members.
vfsChangePermissions "myfile.txt" to (VFS-ATTR-ALL-READ union VFS-ATTR-USER-WRITE union VFS-ATTR-GROUP-WRITE)
Turn off the archive attribute of directory "testdir" and all its contents.
vfsChangePermissions "testdir" to 0 modifying VFS-ATTR-ARCHIVE contents VFS-INCLUDED