Delete a file or directory.
Defined in <physfs.h>
int PHYSFS_delete(const char *filename);| const char * | filename | Filename to delete. |
(int) Returns nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() to obtain the specific error.
filename is specified in platform-independent notation
in relation to the write dir.
A directory must be empty before this call can delete it.
Deleting a symlink will remove the link, not what it points to, regardless of whether you "permitSymLinks" or not.
So if you've got the write dir set to "C:\mygame\writedir" and call PHYSFS_delete("downloads/maps/level1.map") then the file "C:\mygame\writedir\downloads\maps\level1.map" is removed from the physical filesystem, if it exists and the operating system permits the deletion.
Note that on Unix systems, deleting a file may be successful, but the actual file won't be removed until all processes that have an open filehandle to it (including your program) close their handles.
Chances are, the bits that make up the file still exist, they are just made available to be written over at a later point. Don't consider this a security method or anything. :)
It is safe to call this function from any thread.
This function is available since PhysicsFS 1.0.0.