[futurebasic] Re: [FB] Folder permissions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2003 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Fri, 11 Jul 2003 09:34:35 +1200
michael evans wrote:

> /*
> GetOSXPermissions and SetOSXPermissions allow you to see
> and modify the OS X access permissions for a file. These
> routines take an FSSpec, generate an FSRef from it,
> then call FSGetCatalogInfo or FSSetCatalogInfo.
>
> Octal 644 is the default for a newly created file:
> owner has read/write, group has read, others have read.
> Thus by default a file created by an FB app cannot be
> written to (or modified) by another user.
>
> Setting the permissions to octal 666 gives read/write
> permission to all.
>
> Robert P.   25 May 2003
> */


> Has anyone enlarged/updated the 'permissions.bas' to include folder
> permissions?


SetOSXPermissions also works for a folder, but in this case the 
read/write permissions for all are octal 777 (&O777).
(For a folder, the least significant bit must be set in the three octal 
digits).

> Does changing folder permissions on remote servers work the same as 
> doing it
> locally?

I don't know. Check the error code returned by SetOSXPermissions.


>  set the folder permissions to readOK-writeOK-deleteOK.

There is no deleteOK.  There are three permissions fields 
(owner/group/others), each being 1 octal digit. Each digit has 3 bits 
(read, write, execute/directory)

Robert P.