/* Copyright (C)1995-2000 ASH multimedia lab. (http://ash.jp/) */ /************************/ /* ファイルチェック処理 */ /************************/ #include #include #include /* 通常ファイル判定 */ int isfile(path) char *path; /* パス名 */ { struct stat filestat; if (stat(path, &filestat)) {return(0);} if (filestat.st_mode & S_IFREG) {return(1);} return(0); } /* ディレクトリ判定 */ int isdir(path) char *path; /* パス名 */ { struct stat filestat; if (stat(path, &filestat)) {return(0);} if (filestat.st_mode & S_IFDIR) {return(1);} return(0); }