Important: The information in this document is obsolete and should not be used for new development.
HDelete
You can use theHDelete
function to delete a file or directory.
FUNCTION HDelete (vRefNum: Integer; dirID: LongInt; fileName: Str255): OSErr;
vRefNum
- A volume specification (a volume reference number, a working directory reference number, or 0 for the default volume).
dirID
- The directory ID of the parent of the file or directory to delete.
fileName
- The name of the file or directory to delete.
DESCRIPTION
TheHDelete
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 reference is 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,
HDelete
returns the result codefBsyErr
.HDelete
also returns the result codefBsyErr
if the directory has an open working directory associated with it.RESULT CODES