25 #ifndef XAPIAN_INCLUDED_FILETESTS_H
26 #define XAPIAN_INCLUDED_FILETESTS_H
31 #include <type_traits>
42 return stat(path, &st) == 0 &&
S_ISREG(st.st_mode);
78 if (stat(path, &st) == 0) {
128 if (fstat(fd, &st) == 0) {
147 return stat(path, &st) == 0 &&
S_ISDIR(st.st_mode);
169 return stat(path, &st) == 0;
bool dir_exists(const char *path)
Test if a directory exists.
bool path_exists(const char *path)
Test if a path exists.
std::make_unsigned_t< off_t > file_size_type
Unsigned return type of file_size() function.
bool file_exists(const char *path)
Test if a file exists.
file_size_type file_size(const char *path)
Returns the size of a file.
include <sys/stat.h> with portability enhancements