Important: The information in this document is obsolete and should not be used for new development.
FSpDelete
You can use theFSpDelete
function to delete files and directories.
FUNCTION FSpDelete (spec: FSSpec): OSErr;
spec
- An
FSSpec
record specifying the file or directory to delete.DESCRIPTION
TheFSpDelete
function removes a file or directory. If the specified target is a file, both forks of the file are deleted. The file ID reference, if any, is removed.A file must be closed before you can delete it. Similarly, a directory must be empty before you can delete it. If you attempt to delete an open file or a nonempty directory,
FSpDelete
returns the result codefBsyErr
.FSpDelete
also returns the result codefBsyErr
if the directory has an open working directory associated with it.RESULT CODES