FileOps.$getunixpermissions()

Function group Execute on client Platform(s)
FileOps NO Linux, macOS

Syntax

FileOps.$getunixpermissions(cPath)

Description

Returns the Unix permissions string for the file identified by cPath. Pathnames can be over 255 characters, which was the limit in Studio 8.0.1 or earlier.

If an error occurs, it returns an empty string. If it succeeds, then it returns the standard 10 character Unix file permissions string for the file. The first character is either d for a directory, or - for a file. The remaining 9 characters are split into three groups of three characters. The groups are for the user categories owner, group and other, in that order. The characters within each group have the following meanings:

Character index Value
1 r means that members of the user category can read the file; - means they cannot.
2 w means that members of the user category can write to the file; - means they cannot.
3 x means that members of the user category can execute the file; - means they cannot.

Example

Do  FileOps.$getunixpermissions('/omnis/myfile') Returns lPermissions
# returns '-rwxr-xr-x' meaning that the file is only writable by its owner, and readable and executable by all users