#include <config.h>#include "utils.h"#include "xapian/error.h"#include "safedirent.h"#include "safeerrno.h"#include <sys/types.h>#include <cfloat>#include <cmath>

Go to the source code of this file.
Classes | |
| class | dircloser |
Namespaces | |
| namespace | Xapian |
| The Xapian namespace contains public interfaces for the Xapian library. | |
| namespace | Xapian::Internal |
Functions | |
| bool | file_exists (const string &fname) |
| Return true if the file fname exists. | |
| bool | dir_exists (const string &fname) |
| Return true if the directory dirname exists. | |
| void | removedir (const string &dirname) |
| Remove a directory, and its contents. | |
| bool | Xapian::Internal::within_DBL_EPSILON (double a, double b) |
| bool dir_exists | ( | const string & | fname | ) |
Return true if the directory dirname exists.
Definition at line 46 of file utils.cc.
References S_ISDIR, and stat().
Referenced by DEFINE_TESTCASE(), Xapian::DatabaseReplica::Internal::Internal(), and main().
| bool file_exists | ( | const string & | fname | ) |
Return true if the file fname exists.
Definition at line 38 of file utils.cc.
References S_ISREG, and stat().
Referenced by BackendManagerMulti::createdb_multi(), Xapian::Database::Database(), DEFINE_TESTCASE(), FlintTable::exists(), ChertTable::exists(), BrassTable::exists(), test_driver::get_srcdir(), main(), Xapian::DatabaseReplicator::open(), FlintDatabaseReplicator::process_changeset_chunk_blocks(), and Xapian::WritableDatabase::WritableDatabase().
| void removedir | ( | const string & | dirname | ) |
Remove a directory, and its contents.
If dirname doesn't refer to a file or directory, no error is generated.
Note - this doesn't currently cope with directories which contain subdirectories.
Definition at line 66 of file utils.cc.
References dirent::d_name, opendir(), readdir(), and unlink().
Referenced by Xapian::DatabaseReplica::Internal::apply_db_copy(), and Xapian::DatabaseReplica::Internal::remove_offline_db().