Visit Mozilla.org

nsIFile:remove

From MDC

« XPCOM API Reference

Contents

[edit] Summary

This method removes the file or directory corresponding to the file path represented by this nsIFile.

 void remove(
   in boolean aRecursive
 );

[edit] Parameters

aRecursive
[in] If this nsIFile corresponds to a directory that is not empty, then this parameter must be true in order for the directory to be deleted. Otherwise, this parameter is ignored.


[edit] Exceptions Thrown

NS_ERROR_FILE_TARGET_DOES_NOT_EXIST
Indicates that the current file path does not exist. It is not possible to remove a file that does not exist.
NS_ERROR_FILE_DIR_NOT_EMPTY
Indicates that an attempt was made to remove a directory that is not empty.
NS_ERROR_FILE_ACCESS_DENIED
Indicates that an attempt was made to remove a file in a way that exceeded your permissions. Details depend on your file system and how its permissions work.

[edit] See Also

nsIFile