xapian-core
1.4.27
|
Utility functions for testing files. More...
Go to the source code of this file.
Functions | |
bool | file_exists (const char *path) |
Test if a file exists. More... | |
bool | file_exists (const std::string &path) |
Test if a file exists. More... | |
off_t | file_size (const char *path) |
Returns the size of a file. More... | |
off_t | file_size (const std::string &path) |
Returns the size of a file. More... | |
off_t | file_size (int fd) |
Returns the size of a file. More... | |
bool | dir_exists (const char *path) |
Test if a directory exists. More... | |
bool | dir_exists (const std::string &path) |
Test if a directory exists. More... | |
bool | path_exists (const char *path) |
Test if a path exists. More... | |
bool | path_exists (const std::string &path) |
Test if a path exists. More... | |
Utility functions for testing files.
Definition in file filetests.h.
|
inline |
Test if a directory exists.
path | The path to test |
Definition at line 136 of file filetests.h.
References S_ISDIR.
Referenced by Xapian::Database::compact_(), BackendManager::create_dir_if_needed(), DEFINE_TESTCASE(), dir_exists(), BackendManagerChert::do_get_database_path(), BackendManagerGlass::do_get_database_path(), GlassDatabase::GlassDatabase(), Xapian::DatabaseReplica::Internal::Internal(), main(), and rm_rf().
|
inline |
Test if a directory exists.
path | The path to test |
Definition at line 148 of file filetests.h.
References dir_exists().
|
inline |
Test if a file exists.
path | The path to test |
Definition at line 39 of file filetests.h.
References S_ISREG.
Referenced by check_db_dir(), check_glass_table(), Xapian::Database::compact_(), BackendManagerMulti::createdb_multi(), Xapian::Database::Database(), DEFINE_TESTCASE(), BackendManagerSingleFile::do_get_database_path(), ChertTable::exists(), GlassTable::exists(), file_exists(), test_driver::get_srcdir(), Xapian::DatabaseReplicator::open(), and Xapian::WritableDatabase::WritableDatabase().
|
inline |
Test if a file exists.
path | The path to test |
Definition at line 51 of file filetests.h.
References file_exists().
|
inline |
Returns the size of a file.
path | The path to test |
errno is set to 0 (upon success), or the error returned by stat(), or EINVAL (if the path isn't a regular file or a symlink resolving to a regular file).
If the file's size is larger than the maximum value off_t can represent, then stat() will fail with errno=EOVERFLOW, and so will this function. There doesn't seem to be a way to determine the file size in this case, short of reading it all. This is only likely if the LFS check in configure doesn't work out how to enable largefile support.
Definition at line 71 of file filetests.h.
References S_ISREG.
Referenced by ChertTableCheck::check(), GlassDatabase::compact(), ChertDatabase::compact(), file_size(), get_file_size(), and RemoteConnection::send_file().
|
inline |
Returns the size of a file.
path | The path to test |
Note: If the file's size is larger than the maximum value off_t can represent, then stat() will fail with EOVERFLOW, and so will this function. There doesn't seem to be a way to determine the file size in this case, short of reading it all. This is only likely if the LFS check in configure doesn't work out how to enable largefile support.
Definition at line 98 of file filetests.h.
References file_size().
|
inline |
Returns the size of a file.
fd | The file descriptor for the file. |
Note: If the file's size is larger than the maximum value off_t can represent, then stat() will fail with EOVERFLOW, and so will this function. There doesn't seem to be a way to determine the file size in this case, short of reading it all. This is only likely if the LFS check in configure doesn't work out how to enable largefile support.
Definition at line 117 of file filetests.h.
References S_ISREG.
|
inline |
Test if a path exists.
path | The path to test |
Definition at line 158 of file filetests.h.
Referenced by BackendManager::get_database(), BackendManager::get_database_path(), and path_exists().
|
inline |
Test if a path exists.
path | The path to test |
Definition at line 169 of file filetests.h.
References path_exists().