Version: 1.0

Posted: 2005-06-01

Build Requirements: Tiger

Runtime Requirements: Tiger

View Source Code:

Download Sample (“FSCreateFileAndOpenForkUnicode.zip”, 18.2K)
Download Sample (“FSCreateFileAndOpenForkUnicode.dmg”, 76.3K)



Description

This sample is a tool which shows the use of FSCreateFileAndOpenForkUnicode to create a file on disk with restricted access from the outset while allowing the creating process to have a read/write access path to the item. The sample creates the file with a POSIX mode of 000 (no access) and an access control list with a single access control entry which grants the current user read access to the file data. It then writes out some data to the file on the fsRdWrPerm access path it requested. The target volume needs to have extended security enabled since the sample depends on ACLs (the tool checks for this support). FSCreateFileAndOpenForkUnicode enables the creation of files with restricted access on disk while allowing the creator to have less restricted access (a file can be created with no access or read only access and the fork opened with read/write access. Once the inital write path is closed, a subsequent attempt to open the file for writing would fail).

Document Revision History

Date Notes
2005-06-01Demonstartes the use of FSCreateFileAndOpenForkUnicode to create a file with restricted access on disk and a read/write access path.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.