3 /* remove( const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
12 #include <_PDCLIB_glue.h>
14 int remove( const char * filename )
16 /* TODO: Check open file list, flush and close file if open */
17 return _PDCLIB_remove( filename );
23 /* TODO: Work around the following undef */
25 #include <_PDCLIB_test.h>
32 /* TODO: Extend to internal testing (buffer etc.) */
33 char filename[] = "touch testfile";
35 /* file is actually readable */
36 TESTCASE( fopen( filename + 6, "r" ) != NULL );
37 /* remove function does not return error */
38 TESTCASE( remove( filename + 6 ) == 0 );
39 /* file is no longer readable */
40 TESTCASE( fopen( filename + 6, "r" ) == NULL );
41 /* remove function does return error */
42 TESTCASE( remove( filename + 6 ) != 0 );
43 memcpy( filename, "mkdir", 5 );
44 /* create directory */
46 /* remove function does not return error */
47 TESTCASE( remove( filename + 6 ) == 0 );
48 /* remove function does return error */
49 TESTCASE( remove( filename + 6 ) != 0 );