FS_ChangePermissions
Declaration define external function FS_ChangePermissions
value stream path
to value integer mode
status modifiable stream statusvalue
Purpose
The omfsys library has been deprecated and will be removed from a future version of the language. Use omvfs instead.
This function allows you to change the access permissions on a file or a directory.
Input arguments:
- "path" is the valid pathname of the file you want to change the permissions for. The user must either be the owner or have sufficient permissions on the path/files involved.
- "mode" is the new access permission mode for the file. It may be any combination of the following:
- "04000" -- set user ID on execute
- "020#0" -- set group ID on execute if "#" is 7, 5, 3, or 1; enable mandatory file/record locking if "#" is 6, 4, 2, or 0 (zero)
- "01000" -- save text image after execution
- "00700" -- give file owner read, write, and execute permissions
- "00400" -- give file owner read permission
- "00200" -- give file owner write permission
- "00100" -- give file owner execute permission
- "00070" -- give group read, write, and execute permissions
- "00040" -- give group read permission
- "00020" -- give group write permission
- "00010" -- give group execute permission
- "00007" -- give others read, write, and execute permissions
- "00004" -- give others read permission
- "00002" -- give others write permission
- "00001" -- give others execute permission
Output arguments:
- "statusvalue". This will contain either a zero length string if the function succeeds, or one of the following error codes:
- "EACCES" -- no search permission on a component of the pathname
- "EINTR" -- a signal was caught while the function was searching
- "EIO" -- a file system I/O error occurred
- "ELOOP" -- (UNIX only) a symbolic link recursion was detected
- "ENAMETOOLONG" -- the pathname exceeds the system limits
- "ENOENT" -- the specified path does not exist
- "ENOLINK" -- (UNIX only) a required link to a remote machine is inactive
- "ENOTDIR" -- the pathname is not a valid directory
- "EMULTIHOP" -- (UNIX only) remote machine access is required, but not allowed
- "EPERM" -- the user does not have the required permissions
- "EROFS" -- the file resides on a read-only file system
The permissions granted by a call to FS_ChangePermissions cannot exceed those allowed by the operating system.
See the sample programs in the description for FS_MakeDirectory
that show what happens when the permissions assigned by the operating system and those assigned by an OmniMark File System Utilities function conflict.