Important: The information in this document is obsolete and should not be used for new development.
PBHDelete
You can use thePBHDelete
function to delete a file or directory.
FUNCTION PBHDelete (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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to a pathname. --> ioVRefNum
Integer
A volume specification. --> ioDirID
LongInt
A directory ID. DESCRIPTION
ThePBHDelete
function removes a file or directory. If the specified target is a file, both forks of the file are deleted. In addition, if a file ID reference for the specified file exists, that file ID reference is also removed.A file must be closed before you can delete it. Similarly, you cannot delete a directory unless it's empty. If you attempt to delete an open file or a nonempty directory, PBHDelete returns the result code
fBsyErr
. PBHDelete also returnsfBsyErr
if you attempt to delete a directory that has an open working directory associated with it.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBHDelete is_HDelete
.RESULT CODES