Tao.PhysFs SDK Documentation

Fs.PHYSFS_delete Method 

Delete a file or directory.

[Visual Basic]
Public Shared Function PHYSFS_delete( _
   ByVal filename As String _
) As Integer
[C#]
public static int PHYSFS_delete(
   string filename
);

Parameters

filename
Filename to delete.

Return Value

nonzero on success, zero on error. Specifics of the error can be gleaned from PHYSFS_getLastError.

Remarks

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

See Also

Fs Class | Tao.PhysFs Namespace