OW_PosixFileSystem.cpp File Reference

#include "OW_config.h"
#include "OW_FileSystem.hpp"
#include "OW_CryptographicRandomNumber.hpp"
#include "OW_Mutex.hpp"
#include "OW_MutexLock.hpp"
#include "OW_File.hpp"
#include "OW_String.hpp"
#include "OW_Array.hpp"
#include "OW_Format.hpp"
#include "OW_ExceptionIds.hpp"
#include "OW_Assertion.hpp"
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <cstdio>
#include <fstream>
#include <cerrno>

Include dependency graph for OW_PosixFileSystem.cpp:

Go to the source code of this file.


namespace  OW_NAMESPACE
namespace  OW_NAMESPACE::FileSystem
namespace  OW_NAMESPACE::FileSystem::Path


#define _ACCESS   ::access
#define _CHDIR   chdir
#define _MKDIR(a, b)   mkdir((a),(b))
#define _RMDIR   rmdir
#define _UNLINK   unlink


int OW_NAMESPACE::FileSystem::changeFileOwner (const String &filename, const UserId &userId)
 Change the given file ownership.
File OW_NAMESPACE::FileSystem::openFile (const String &path)
 Open a file for read/write and return an File object that can be used for reading and writing.
File OW_NAMESPACE::FileSystem::createFile (const String &path)
 Create the file for the given name.
File OW_NAMESPACE::FileSystem::openOrCreateFile (const String &path)
 Opens or creates the file for the given name.
bool OW_NAMESPACE::FileSystem::exists (const String &path)
bool OW_NAMESPACE::FileSystem::isExecutable (const String &path)
 Tests if a file is executable.
bool OW_NAMESPACE::FileSystem::canRead (const String &path)
bool OW_NAMESPACE::FileSystem::canWrite (const String &path)
bool OW_NAMESPACE::FileSystem::isLink (const String &path)
 Tests if a file is a symbolic link.
bool OW_NAMESPACE::FileSystem::isDirectory (const String &path)
bool OW_NAMESPACE::FileSystem::changeDirectory (const String &path)
 Change to the given directory.
bool OW_NAMESPACE::FileSystem::makeDirectory (const String &path, int mode=0777)
 Create a directory.
bool OW_NAMESPACE::FileSystem::getFileSize (const String &path, off_t &size)
 Get the size of the file in bytes.
bool OW_NAMESPACE::FileSystem::removeDirectory (const String &path)
 Remove the given directory.
bool OW_NAMESPACE::FileSystem::removeFile (const String &path)
 Remove the given file.
bool OW_NAMESPACE::FileSystem::getDirectoryContents (const String &path, StringArray &dirEntries)
 Get the names of the files (and directories) in the given directory.
bool OW_NAMESPACE::FileSystem::renameFile (const String &oldFileName, const String &newFileName)
 Rename the given file to the new name.
size_t OW_NAMESPACE::FileSystem::read (const FileHandle &hdl, void *bfr, size_t numberOfBytes, off_t offset=-1L)
 Read data from file.
size_t OW_NAMESPACE::FileSystem::write (FileHandle &hdl, const void *bfr, size_t numberOfBytes, off_t offset=-1L)
 Write data to a file.
off_t OW_NAMESPACE::FileSystem::seek (const FileHandle &hdl, off_t offset, int whence)
 Seek to a given offset within the file.
off_t OW_NAMESPACE::FileSystem::tell (const FileHandle &hdl)
void OW_NAMESPACE::FileSystem::rewind (const FileHandle &hdl)
 Position the file pointer associated with the given file handle to the beginning of the file.
int OW_NAMESPACE::FileSystem::close (const FileHandle &hdl)
 Close file handle.
int OW_NAMESPACE::FileSystem::flush (FileHandle &hdl)
 Flush any buffered data to the file if buffering supported.
void OW_NAMESPACE::FileSystem::initRandomFile (const String &file)
 Create a file with random data.
String OW_NAMESPACE::FileSystem::getFileContents (const String &filename)
 Read and return the contents of a text file.
StringArray OW_NAMESPACE::FileSystem::getFileLines (const String &filename)
 Read and return the lines of a test file.
String OW_NAMESPACE::FileSystem::readSymbolicLink (const String &path)
 Read the value of a symbolic link.
String OW_NAMESPACE::FileSystem::Path::realPath (const String &path)
 Convert path to the canonicalized absolute pathname by expanding all symbolic links and resolving references to /.
String OW_NAMESPACE::FileSystem::Path::dirname (const String &filename)
 Take a string that contains a pathname, and return a string that is a pathname of the parent directory of that file.
String OW_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory ()
 Get the process's current working directory.

Define Documentation

#define _ACCESS   ::access

Jon Carey

Dan Nuffer

Definition at line 74 of file OW_PosixFileSystem.cpp.

Referenced by OW_NAMESPACE::FileSystem::canRead(), OW_NAMESPACE::FileSystem::canWrite(), OW_NAMESPACE::FileSystem::exists(), and OW_NAMESPACE::FileSystem::isExecutable().

#define _CHDIR   chdir

Definition at line 75 of file OW_PosixFileSystem.cpp.

Referenced by OW_NAMESPACE::FileSystem::changeDirectory().

#define _MKDIR a,
 )     mkdir((a),(b))

Definition at line 76 of file OW_PosixFileSystem.cpp.

Referenced by OW_NAMESPACE::FileSystem::makeDirectory().

#define _RMDIR   rmdir

Definition at line 77 of file OW_PosixFileSystem.cpp.

Referenced by OW_NAMESPACE::FileSystem::removeDirectory().

#define _UNLINK   unlink

Definition at line 78 of file OW_PosixFileSystem.cpp.

Referenced by OW_NAMESPACE::FileSystem::removeFile().

Generated on Thu Feb 9 09:03:14 2006 for openwbem by  doxygen 1.4.6