|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <unistd.h> int unlink(const char *file);
This function removes a file from the file system.
Zero on success, nonzero on failure.
|POSIX||1003.2-1992 (partial); 1003.1-2001 (partial) (see note 1)|
unlinkdoes not fully comply with the specs; if the file you want to unlink is open, you're asking for trouble -- how much trouble depends on the underlying OS. On Windows NT (and possibly on Windows 2000 as well), you get the behaviour POSIX expects. On Windows 9x and Windows ME (and possibly Windows XP as well), the removal will simply fail (
errnogets set to
EACCES). On DOS, removing an open file could lead to filesystem corruption if the removed file is written to before it's closed.
|webmaster||delorie software privacy|
|Copyright © 2004 by DJ Delorie||Updated Apr 2004|