Platforms to show: All Mac Windows Linux Cross-Platform

Back to FolderItem class.

FolderItem.PermissionsMBS(OldWay as boolean) as PermissionsMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS MacOSX Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an object for the Permissions of a file.
Example
dim f as FolderItem
dim p as PermissionsMBS

f=GetOpenFolderItem("special/any")

if f<>nil then
p=f.PermissionsMBS(true)

if p<>Nil then // requires Mac OS X
p.Access=&H6

// &h000006 = -rw-------
// &h000600 = ----rw----
// &h060000 = -------rw-

if 0=p.SetPermissions(true) then
MsgBox "Permissions set"
else
MsgBox "Permissions could not be set"
end if
else
MsgBox "We require Mac OS X"
end if
else
' nothing selected
end if

You can use old API if you set Oldway=true. Than you set access value like in older version of the plugin.
If you set Oldway = false, you use the newer API which set unix permissions, but not the old ones.
The old way is not supported for 64bit.

Some examples using this method:

The items on this page are in the following plugins: MBS MacOSX Plugin.


The biggest plugin in space...