| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflfile.h" int file_delete ( const char *filename)
Deletes the specified file. Returns 0 if okay, -1 in case of an error.
{ #if (defined (__VMS__)) ASSERT (filename); return (remove (filename)); #elif (defined (WIN32)) int rc; ASSERT (filename); if (system_devicename (filename)) return (-1); /* Not allowed on device names */ rc = !DeleteFile (filename); if (rc && errno == EACCES) { /* Under WinNT and Win95, a delete of a freshly-created file can * sometimes fail with a permission error which passes after a * short delay. Ugly but it seems to work. */ Sleep (200); rc = !DeleteFile (filename); } return (rc); #else ASSERT (filename); return (unlink (filename)); #endif }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |