/* FUNCTION <>---delete a file's name INDEX remove ANSI_SYNOPSIS #include int remove(char *<[filename]>); int _remove_r(void *<[reent]>, char *<[filename]>); TRAD_SYNOPSIS #include int remove(<[filename]>) char *<[filename]>; int _remove_r(<[reent]>, <[filename]>) char *<[reent]>; char *<[filename]>; DESCRIPTION Use <> to dissolve the association between a particular filename (the string at <[filename]>) and the file it represents. After calling <> with a particular filename, you will no longer be able to open the file by that name. In this implementation, you may use <> on an open file without error; existing file descriptors for the file will continue to access the file's data until the program using them closes the file. The alternate function <<_remove_r>> is a reentrant version. The extra argument <[reent]> is a pointer to a reentrancy structure. RETURNS <> returns <<0>> if it succeeds, <<-1>> if it fails. PORTABILITY ANSI C requires <>, but only specifies that the result on failure be nonzero. The behavior of <> when you call it on an open file may vary among implementations. Supporting OS subroutine required: <>. */ #include #include int _remove_r (ptr, filename) struct _reent *ptr; _CONST char *filename; { if (_unlink_r (ptr, filename) == -1) return -1; return 0; } #ifndef _REENT_ONLY int remove (filename) _CONST char *filename; { return _remove_r (_REENT, filename); } #endif