libfoedus-core
FOEDUS Core Library
filesystem.hpp File Reference
#include <iosfwd>
#include <string>
#include "foedus/cxx11.hpp"
#include "foedus/error_code.hpp"
#include "foedus/fwd.hpp"
#include "foedus/initializable.hpp"
#include "foedus/assorted/fixed_string.hpp"
#include "foedus/fs/path.hpp"
Include dependency graph for filesystem.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  foedus::fs::FileStatus
 Analogue of boost::filesystem::file_status. More...
 
struct  foedus::fs::SpaceInfo
 Analogue of boost::filesystem::space_info. More...
 

Namespaces

 foedus
 Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
 
 foedus::fs
 Filesystem wrapper, an analogue of boost::filesystem.
 

Typedefs

typedef assorted::FixedString< 508 > foedus::fs::FixedPath
 Represents a fixed (thus can be placed in shared memory) path string. More...
 

Enumerations

enum  foedus::fs::FileType {
  foedus::fs::kStatusError = 0, foedus::fs::kFileNotFound, foedus::fs::kRegularFile, foedus::fs::kDirectoryFile,
  foedus::fs::kTypeUnknown
}
 Analogue of boost::filesystem::file_type. More...
 
enum  foedus::fs::FilePermission {
  foedus::fs::kNoPerms = 0, foedus::fs::kOwnerRead = 0400, foedus::fs::kOwnerWrite = 0200, foedus::fs::kOwnerExe = 0100,
  foedus::fs::kOwnerAll = 0700, foedus::fs::kGroupRead = 040, foedus::fs::kGroupWrite = 020, foedus::fs::kGroupExe = 010,
  foedus::fs::kGroupAll = 070, foedus::fs::kOthersRead = 04, foedus::fs::kOthersWrite = 02, foedus::fs::kOthersExe = 01,
  foedus::fs::kOthersAll = 07, foedus::fs::kAllAll = kOwnerAll|kGroupAll|kOthersAll, foedus::fs::kPermsNotKnown = 0xFFFF
}
 Analogue of boost::filesystem::perm. More...
 

Functions

FileStatus foedus::fs::status (const Path &p)
 Returns the status of the file. More...
 
bool foedus::fs::exists (const Path &p)
 Returns if the file exists. More...
 
bool foedus::fs::is_directory (const Path &p)
 Returns if the file is a directory. More...
 
bool foedus::fs::is_regular_file (const Path &p)
 Returns if the file is a regular file. More...
 
Path foedus::fs::current_path ()
 Returns the current working directory. More...
 
Path foedus::fs::home_path ()
 Returns the absolute path of the home directory of the user running this process. More...
 
Path foedus::fs::absolute (const std::string &p)
 Returns the absolue path of the specified path. More...
 
bool foedus::fs::create_directories (const Path &p, bool sync=false)
 Recursive mkdir (mkdirs). More...
 
bool foedus::fs::create_directory (const Path &p, bool sync=false)
 mkdir. More...
 
uint64_t foedus::fs::file_size (const Path &p)
 Returns size of the file. More...
 
bool foedus::fs::remove (const Path &p)
 Deletes a regular file or an empty directory. More...
 
uint64_t foedus::fs::remove_all (const Path &p)
 Recursively deletes a directory. More...
 
SpaceInfo foedus::fs::space (const Path &p)
 Returns free space information for the device the file is on. More...
 
std::string foedus::fs::unique_name (uint64_t differentiator=0)
 Equivalent to unique_path("%%%%-%%%%-%%%%-%%%%"). More...
 
std::string foedus::fs::unique_name (const std::string &model, uint64_t differentiator=0)
 Returns a randomly generated file name with the given template. More...
 
bool foedus::fs::fsync (const Path &path, bool sync_parent_directory=false)
 Makes the content and metadata of the file durable all the way up to devices. More...
 
bool foedus::fs::atomic_rename (const Path &old_path, const Path &new_path)
 Renames the old file to the new file with the POSIX atomic-rename semantics. More...
 
bool foedus::fs::durable_atomic_rename (const Path &old_path, const Path &new_path)
 fsync() on source file before rename, then fsync() on the parent folder after rename. More...
 
bool foedus::fs::rename (const Path &old_path, const Path &new_path)
 Just a synonym of atomic_rename() to avoid confusion. More...