Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
File System Specification Routines / Accessing Information About Files and Directories


FSpSetFLock

You can use the FSpSetFLock function to lock a file.

FUNCTION FSpSetFLock (spec: FSSpec): OSErr; 
spec
An FSSpec record specifying the file to lock.
DESCRIPTION
The FSpSetFLock function locks a file. After you lock a file, all new access paths to that file are read-only. This function has no effect on existing access paths.

If the PBHGetVolParms function indicates that the volume supports folder locking (that is, the bHasFolderLock bit of the vMAttrib field is set), you can use FSpSetFLock to lock a directory.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for FSpSetFLock are
Trap macroSelector
_HighLevelHFSDispatch$0009

RESULT CODES
noErr0No error
nsvErr-35No such volume
ioErr-36I/O error
fnfErr-43File not found
wPrErr-44Hardware volume lock
vLckdErr-46Software volume lock
dirNFErr-120Directory not found or incomplete pathname
afpAccessDenied-5000User does not have the correct access to the file
afpObjectTypeErr-5025Folder locking not supported by volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996