SetFilePermissions

Description:

baSetFilePermissions sets the UNIX permissions of a file.

Platforms:

Macintosh

Usage:

Result = baSetFilePermissions( FileName, User, Permissions )

Arguments:

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

"u" 

the present user

"g" 

the current group

"o" 

all other users
Permissions are the permissions to set. Can be a combination of:

"r" 

read access allowed

"w" 

write access allowed

"x" 

execute access allowed

Returns:

Integer.
Returns 1 if successful, else 0.

Examples:

Director:
ok = baSetFilePermissions( "Mac HD:data:student.dat", "u", "rw" )

Authorware:
ok := baSetFilePermissions( "Mac HD:data:student.dat", "o", "x" )
 

Notes:

The file permissions will be set to what you pass in "rw" will set the read and write
access and remove the execute access, regardless of the present settings.

If you pass in a plus sign as the first character, then the permissions will be added
to the present permissions "+r" will add read access without changing the present write and execute settings.

If you pass in a minus sign as the first character, then the permissions will be removed from the present permissions "wx"
will remove the write and execute access without changing the present read setting.

To set the permissions of a folder, you need to make sure that the folder name ends with a folder separator ( : or / ).
 

See also:

baFilePermissions