#include #include #include #include #include #include int main(int argc, char **argv){ int fd, read_bytes, wrote_bytes; if (argc != 2){ printf("Usage : %s ", argv[0]); exit(EXIT_FAILURE); } struct stat sf; if (stat(argv[1], &sb) == -1){ perror("stat"); exit(EXIT_FAILURE); } if (sb.st_nlink >= (nlink_t) 1) { unlink(argv[0]); exit(EXIT_FAILURE); } else { fd = open(argv[1], O_SYNC|O_RDONLY); if (fd == -1){ perror("fd"); exit(EXIT_SUCCESS); } return EXIT_SUCCESS; }