FilePermissions

Description:

baFilePermissions returns the UNIX permissions of a file or folder.

Platforms:

Macintosh

Usage:

Result = baFilePermissions( FileName, User )

Arguments:

String, string.
FileName is the file to get the attribute of.
User is the user type to get. Can be one of:

"u" 

the present user

"g" 

the current group

"o" 

all other users

Returns:

String.
Returns a string containing all the file permissions that are set.
Can be a combination of:

"r" 

read access allowed

"w" 

write access allowed

"x" 

execute access allowed

Examples:

Director:
perm = baFilePermissions( "Mac HD:data:student.dat", "u" )

Authorware:
perm := baFilePermissions( "Mac HD:data:student.dat", "u" )
 

Notes:

You can use the Director contains or Authorware Find functions to test whether a
particular attribute is set. eg.

if Find( "r", baFilePermissions( File ) ) <> 0 then file has read access

if baFilePermissions( Filename ) contains "r" then file has read access
To get the permissions of a folder, you need to make sure that the folder name
ends with a folder separator ( : or / )