/* * Copyright (c) 1994 by the University of Southern California * * For copying and distribution information, please see the file * . */ #include #include #include /* Is this a file? uses stat() */ #include /* for prototypes */ /* Is it a regular file? 1 = yes, 0 = no, -1 = failure? */ extern int is_file(const char native_filename[]) { struct stat st_buf; if(stat(native_filename, &st_buf) == 0) return S_ISREG(st_buf.st_mode) ? 1 : 0; else return -1; }