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 32 of file FileUtils.h.


Static Public Member Functions

static bool readable (const char *path, const char *log=0)
static int size (const char *path, const char *log=0)
 Return the size of the file or -1 on error.
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 29 of file FileUtils.cc.

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

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

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

Return the size of the file or -1 on error.

Definition at line 57 of file FileUtils.cc.

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

Referenced by oasys::MmapFile::map().

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

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

Definition at line 83 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 96 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 Sat Sep 8 08:36:24 2007 for DTN Reference Implementation by  doxygen 1.5.3