DeleteFile

Files
Aptilis 1

DeleteFile(FileName)

DeleteFile erases a file and removes its name from the directory where it was.
You have to be careful with this function, because, especially under Unix, a file deleted is a file lost... forever!

A locked file you call delete upon, will be unlocked unconditinally (even if you locked it several times) and then deleted. In effect, no only do you delete the file, but you also allow other processes to get a lock on that file name.

Return Value:
0 if everything was OK.
-1 in case of error and the _errno variable contains more details about the error.

See also Lock and Unlock.