시스템프로그래밍 FTW 구현
FTW() 란? ftw함수는 해당 경로안의 모든 디렉토리들을 탐색하여 보여준다.
SYNOPSIS #include <ftw.h>
int ftw(const char *path, int (*fn)(const char *, const struct sta *ptr, int flag),int depth);
int nftw(const char *path, int (*fn)(const char *, const struct stat *ptr, int flag, struct FTW *), int depth, int flags);
ftw는 path, fn, depth의 3가지 인자가 필요하다.
path : 탐색될 대상이 되는 경로.
fn : 탐색중 발견된 파일의 정보를 받는 콜백 포인터.