oasys::FileUtils Class Reference

#include <FileUtils.h>

List of all members.


Detailed Description

Abstraction class for some stateless file operations such as probing to see if a file and/or directory exists, is readable, etc.

For most operations, this is just a simpler interface to the stat() system call.

Definition at line 53 of file FileUtils.h.

Static Public Member Functions

static bool readable (const char *path, const char *log=0)
static size_t size (const char *path, const char *log=0)
static void abspath (std::string *path)
 Make sure the given path is absolute, prepending the current directory if necessary.
static int rm_all_from_dir (const char *path)
 Deletes all of the files from a given directory.


Member Function Documentation

bool oasys::FileUtils::readable ( const char *  path,
const char *  log = 0 
) [static]

Definition at line 50 of file FileUtils.cc.

References errno, oasys::LOG_DEBUG, and oasys::logf().

Referenced by dtn::DTNServer::parse_conf_file().

size_t oasys::FileUtils::size ( const char *  path,
const char *  log = 0 
) [static]

Definition at line 78 of file FileUtils.cc.

References errno, oasys::LOG_DEBUG, and oasys::logf().

void oasys::FileUtils::abspath ( std::string *  path  )  [static]

Make sure the given path is absolute, prepending the current directory if necessary.

Definition at line 104 of file FileUtils.cc.

Referenced by oasys::FileSystemStore::init(), oasys::BerkeleyDBStore::init(), and dtn::DTNServer::tidy_dir().

int oasys::FileUtils::rm_all_from_dir ( const char *  path  )  [static]

Deletes all of the files from a given directory.

Returns:
0 on success, errno otherwise

Definition at line 117 of file FileUtils.cc.

References ASSERT, and errno.

Referenced by oasys::FileSystemStore::del_table().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:06 2006 for DTN Reference Implementation by  doxygen 1.5.1