Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Files.SetPosixPermissions

Sets posix file permissions.

Component Version macOS Windows Linux Server iOS SDK
Files 4.3 ✅ Yes ❌ No ✅ Yes ✅ Yes, on macOS and Linux ✅ Yes
MBS( "Files.SetPosixPermissions"; Path; Mode )   More

Parameters

Parameter Description Example
Path The native path to the file or folder. "/Users/John/Desktop/test.txt"
Mode The new mode. "777"

Result

Returns OK or error message.

Description

Sets posix file permissions.
Path must be valid and exist.

See chmod command man page in Terminal. The plugin converts parameter to string and parses it as octal number. This way you can pass 777 as number and it's interpreted as expected.

See also Files.SetReadOnly for Windows.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Set permissions

MBS( "Files.SetPosixPermissions"; "/Users/cs/Desktop/test"; "755" )

See also

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 11st September 2022


Files.SetModificationDate - Files.SetReadOnly