Delete a File
From Erlang Community
You want to delete a file.
Use Erlang's standard function file:delete.
1> file:delete("/this/file/will/soon/be/gone.txt"). ok
The function deletes the file with the given pathname, if it exists, returning ok if a file was deleted successfully, otherwise an error is returned.
Note that if you wish to delete a directory, you should use the corresponding function file:del_dir.
2> file:del_dir("/this/dir/will/soon/be/gone"). ok
The function deletes the given directory if it exists, returning ok if successful. An error will be returned if any part of the directory path is not a directory.