company logo

File :: erase - Erase file

The function erases the file or directory. When the path refers to a directory, the directory must be empty. Otherwise, an exception is thrown. In order to erase non-empty directories, eraseDirectory() may be called.

When erasing a file that is still opened, the file will be closed before deleting.

When the path is not valid, the function throws an exception. In order to avoid exceptions, one may call exist() before calling erase() .

Implementation details

File  :: erase (  )