tests/harness/unixcmds.cc File Reference

C++ function versions of useful Unix commands. More...

#include <config.h>
#include "unixcmds.h"
#include <cstring>
#include <string>
#include <stdlib.h>
#include <sys/types.h>
#include "safesysstat.h"
#include "safeunistd.h"
#include "safefcntl.h"
#include "stringutils.h"
#include "utils.h"

Include dependency graph for unixcmds.cc:

Go to the source code of this file.

Functions

static bool append_filename_argument (string &cmd, const string &arg)
 Append filename argument arg to command cmd with suitable escaping.
void cp_R (const std::string &src, const std::string &dest)
 Recursively copy a directory, just like the Unix "cp -R" command.
void rm_rf (const string &filename)
 Remove a directory and contents, just like the Unix "rm -rf" command.
void touch (const string &filename)
 Touch a file, just like the Unix "touch" command.


Detailed Description

C++ function versions of useful Unix commands.

Definition in file unixcmds.cc.


Function Documentation

static bool append_filename_argument ( string &  cmd,
const string &  arg 
) [static]

Append filename argument arg to command cmd with suitable escaping.

Definition at line 44 of file unixcmds.cc.

References C_isalnum().

Referenced by cp_R(), and rm_rf().

void cp_R ( const std::string &  src,
const std::string &  dest 
)

Recursively copy a directory, just like the Unix "cp -R" command.

Definition at line 85 of file unixcmds.cc.

References append_filename_argument(), mkdir(), and system().

Referenced by DEFINE_TESTCASE().

void rm_rf ( const string &  filename  ) 

Remove a directory and contents, just like the Unix "rm -rf" command.

Definition at line 124 of file unixcmds.cc.

References append_filename_argument(), S_ISDIR, stat(), and system().

Referenced by DEFINE_TESTCASE(), do_create(), main(), and removedir().

void touch ( const string &  filename  ) 

Touch a file, just like the Unix "touch" command.

Definition at line 147 of file unixcmds.cc.

References O_BINARY, and Xapian::Remote::open().

Referenced by DEFINE_TESTCASE().


Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.