Important: The information in this document is obsolete and should not be used for new development.
PBHSetFLock
You can use thePBHSetFLockfunction to lock a file.
FUNCTION PBHSetFLock (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock- A pointer to a basic HFS parameter block.
async- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine. <-- ioResultOSErrThe result code of the function. --> ioNamePtrStringPtrA pointer to a pathname. --> ioVRefNumIntegerA volume specification. --> ioDirIDLongIntA directory ID. DESCRIPTION
ThePBHSetFLockfunction locks the file with the name pointed to byioNamePtron the volume specified byioVRefNum. After you lock a file, all new access paths to that file are read-only. Access paths currently in use aren't affected.If the
PBHGetVolParmsfunction indicates that the volume supports folder locking (that is, thebHasFolderLockbit of thevMAttribfield is set), you can usePBHSetFLockto lock a directory.ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBHSetFLockis_HSetFLock.RESULT CODES