xapian-core  1.4.27
Classes | Functions
fileutils.cc File Reference

File and path manipulation routines. More...

#include <config.h>
#include "fileutils.h"
#include "xapian/error.h"
#include "safedirent.h"
#include "safeunistd.h"
#include <cerrno>
#include <cstring>
#include <string>
#include <sys/types.h>
+ Include dependency graph for fileutils.cc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dircloser
 

Functions

void removedir (const string &dirname)
 Remove a directory, and its contents. More...
 
void resolve_relative_path (string &path, const string &base)
 Resolve path relative to base. More...
 

Detailed Description

File and path manipulation routines.

Definition in file fileutils.cc.

Function Documentation

◆ removedir()

void removedir ( const std::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 50 of file fileutils.cc.

References dirent::d_name, name, opendir(), and readdir().

Referenced by Xapian::DatabaseReplica::Internal::apply_db_copy(), and Xapian::DatabaseReplica::Internal::remove_offline_db().

◆ resolve_relative_path()

void resolve_relative_path ( std::string &  path,
const std::string &  base 
)

Resolve path relative to base.

Return path qualified to work as if you did "chdir(<directory which base is in>)" first.

Definition at line 105 of file fileutils.cc.

Referenced by r_r_p(), and read_stub_file().