On 11/1/07, Tolu Fapohunda <email@hidden> wrote:
> Hello,
>
> I need to determine if a file is read only based on its attributes, the
> attributes of each parent folder(s), and on it volume on which it resides.
> For example, a file on a CD should always be read only. Is there an OS call
> to accomplish this?
>
> I am able to get the attributes of files and directories by themselves using
> PBGetCatalogInfoSync and PBHGetDirAccessSync respectively. Currently, what
> I do is check the file, check each parent directory of the file, and then
> finally check the volume in which the file resides. This is way too much
> and it seems like I am missing something here.
You don't need to check the parent directories: a read-write file can
exist in a read-only directory. You only need to check the
permissions (POSIX and ACL) of the file itself, and check to see if
the file is on a read-only volume.
--
Mark Wagner
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden