Function physfs_sys::PHYSFS_delete[][src]

pub unsafe extern "C" fn PHYSFS_delete(
    filename: *const c_char
) -> c_int
Expand description

\fn int PHYSFS_delete(const char *filename) \brief Delete a file or directory.

(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. :)

\param filename Filename to delete. \return nonzero on success, zero on error. Use PHYSFS_getLastErrorCode() to obtain the specific error.