25 #ifndef XAPIAN_INCLUDED_FILETESTS_H 26 #define XAPIAN_INCLUDED_FILETESTS_H 41 return stat(path, &st) == 0 &&
S_ISREG(st.st_mode);
73 if (stat(path, &st) == 0) {
119 if (fstat(fd, &st) == 0) {
138 return stat(path, &st) == 0 &&
S_ISDIR(st.st_mode);
160 return stat(path, &st) == 0;
173 #endif // XAPIAN_INCLUDED_FILETESTS_H
include <sys/stat.h> with portability enhancements
bool dir_exists(const char *path)
Test if a directory exists.
off_t file_size(const char *path)
Returns the size of a file.
bool path_exists(const char *path)
Test if a path exists.
bool file_exists(const char *path)
Test if a file exists.