Tutorial by Examples

#include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <dirent.h> #include <ctype.h> int main(int argc, char **argv) { const char *dname = (argc > 1 ? argv[1] : "."); DI...
#define _XOPEN_SOURCE 500 #include <stdlib.h> /* for exit() */ #include <stdio.h> /* for remove() */ #include <ftw.h> /* for nftw() */ int unlink_cb( const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) { return remove(fpath); } in...
#include <stddef.h> /* for offsetof() */ #include <stdlib.h> /* for exit() */ #include <stdio.h> /* for perror() */ #include <string.h> /* for strcmp() */ #include <unistd.h> /* for close(), unlink() */ #include <fcntl.h> /* for open() */ #incl...

Page 1 of 1