Important: The information in this document is obsolete and should not be used for new development.
FSpDelete
You can use theFSpDeletefunction to delete files and directories.
FUNCTION FSpDelete (spec: FSSpec): OSErr;
spec- An
FSSpecrecord specifying the file or directory to delete.DESCRIPTION
TheFSpDeletefunction 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,
FSpDeletereturns the result codefBsyErr.FSpDeletealso returns the result codefBsyErrif the directory has an open working directory associated with it.RESULT CODES