Created
April 23, 2012 10:42
-
-
Save kwilczynski/2470160 to your computer and use it in GitHub Desktop.
ftw.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ftw.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int callback(const char *name, const struct stat *status, int type); | |
| int main(int argc, char *argv[]) | |
| { | |
| char *root = "."; | |
| ftw((char *) root, callback, 1); | |
| return 0; | |
| } | |
| int callback(const char *name, const struct stat *status, int type) | |
| { | |
| if (type == FTW_NS) | |
| return 0; | |
| if (type == FTW_F || type == FTW_SL || type == FTW_D) | |
| printf("%s\n", name); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment