## Deleting Directory Files

The del command cannot be used to directly delete a directory file. If a directory file that still contained file names were to be deleted, OS-9 would have no way to access the files or to return their storage to the unallocated storage pool. Therefore, the following sequence must be performed to delete a directory file:

1. All file names in the directory must be deleted.

2. The attr command is used to turn off the files directory attrribute (-d option), making it an ordinary file (see the section called “The File Security System”).

3. The file may now be deleted using the del command.

A simpler alternative is to use the deldir command to automatically perform all these steps for you.