#include <stdio.h> #include <unistd.h> #define FOO "foo" int main(void) { if(!access(FOO, F_OK)) { if(!unlink(FOO)) { } else { printf("remove %s failed/n", FOO); } } else { printf("%s not existed/n", FOO); } return 0; }