Next: , Previous: , Up: Files   [Contents][Index]


35.10 Creating and Deleting Directories

Most SXEmacs Lisp file-manipulation functions get errors when used on files that are directories. For example, you cannot delete a directory with delete-file. These special functions exist to create and delete directories.

Command: make-directory dirname &optional parents

This function creates a directory named dirname. Interactively, the default choice of directory to create is the current default directory for file names. That is useful when you have visited a file in a nonexistent directory.

Non-interactively, optional argument parents says whether to create parent directories if they don’t exist. (Interactively, this always happens.)

Command: delete-directory dirname

This function deletes the directory named dirname. The function delete-file does not work for files that are directories; you must use delete-directory in that case.