Syntax Edit

KILL path$ [,refNum% [,dirID&]]

Description Edit

This statement deletes a (closed, unlocked) file or folder from the disk. The path$ parameter can be either a full or partial pathname; the refNum% parameter can be a working directory reference number, a volume reference number, a drive ID number, or zero. The dirID& parameter is a directory ID number of the item's parent directory. If dirID& is not specified, then the current PARENTID value (if nonzero) is used instead. KILL resets the PARENTID value to zero after the item is deleted.

The easiest way to use this statement is to specify the item's name in path$, the volume reference number of its volume in refNum%, and the ID number of its parent directory in dirID&. For other ways to use these parameters, see Appendix A: Specifying Files and Folders.

You cannot delete a folder if it has any contents, nor if the folder is "open." A folder is considered "open" if your program has executed any statement which returned a working directory reference number for the folder, and has not subsequently closed it using the CLOSE FOLDER statement.

See Also Edit