libfoedus-core
FOEDUS Core Library
|
Filesystem wrapper, an analogue of boost::filesystem. More...
Filesystem wrapper, an analogue of boost::filesystem.
These methods abstract accesses to filesystems like boost::filesystem and std::filesystem in C++1z(?). We should not directly call POSIX or Windows filesystem APIs in other modules. Instead, all of them should go through this package.
Classes | |
struct | DeviceEmulationOptions |
Set of configurations to emulate slower devices for some experiments. More... | |
class | DirectIoFile |
Represents an I/O stream on one file without filesystem caching. More... | |
struct | FileStatus |
Analogue of boost::filesystem::file_status. More... | |
class | Path |
Analogue of boost::filesystem::path. More... | |
struct | SpaceInfo |
Analogue of boost::filesystem::space_info. More... | |
Typedefs | |
typedef assorted::FixedString< 508 > | FixedPath |
Represents a fixed (thus can be placed in shared memory) path string. More... | |
Enumerations | |
enum | FileType { kStatusError = 0, kFileNotFound, kRegularFile, kDirectoryFile, kTypeUnknown } |
Analogue of boost::filesystem::file_type. More... | |
enum | FilePermission { kNoPerms = 0, kOwnerRead = 0400, kOwnerWrite = 0200, kOwnerExe = 0100, kOwnerAll = 0700, kGroupRead = 040, kGroupWrite = 020, kGroupExe = 010, kGroupAll = 070, kOthersRead = 04, kOthersWrite = 02, kOthersExe = 01, kOthersAll = 07, kAllAll = kOwnerAll|kGroupAll|kOthersAll, kPermsNotKnown = 0xFFFF } |
Analogue of boost::filesystem::perm. More... | |
Functions | |
FileStatus | status (const Path &p) |
Returns the status of the file. More... | |
bool | exists (const Path &p) |
Returns if the file exists. More... | |
bool | is_directory (const Path &p) |
Returns if the file is a directory. More... | |
bool | is_regular_file (const Path &p) |
Returns if the file is a regular file. More... | |
Path | current_path () |
Returns the current working directory. More... | |
Path | home_path () |
Returns the absolute path of the home directory of the user running this process. More... | |
Path | absolute (const std::string &p) |
Returns the absolue path of the specified path. More... | |
bool | create_directories (const Path &p, bool sync=false) |
Recursive mkdir (mkdirs). More... | |
bool | create_directory (const Path &p, bool sync=false) |
mkdir. More... | |
uint64_t | file_size (const Path &p) |
Returns size of the file. More... | |
bool | remove (const Path &p) |
Deletes a regular file or an empty directory. More... | |
uint64_t | remove_all (const Path &p) |
Recursively deletes a directory. More... | |
SpaceInfo | space (const Path &p) |
Returns free space information for the device the file is on. More... | |
std::string | unique_name (uint64_t differentiator=0) |
Equivalent to unique_path("%%%%-%%%%-%%%%-%%%%"). More... | |
std::string | unique_name (const std::string &model, uint64_t differentiator=0) |
Returns a randomly generated file name with the given template. More... | |
bool | 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 | 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 | 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 | rename (const Path &old_path, const Path &new_path) |
Just a synonym of atomic_rename() to avoid confusion. More... | |
bool | operator== (const Path &lhs, const Path &rhs) |
bool | operator== (const Path &lhs, const std::string &rhs) |
bool | operator== (const std::string &lhs, const Path &rhs) |
bool | operator!= (const Path &lhs, const Path &rhs) |
bool | operator!= (const Path &lhs, const std::string &rhs) |
bool | operator!= (const std::string &lhs, const Path &rhs) |
bool | operator< (const Path &lhs, const Path &rhs) |
bool | operator<= (const Path &lhs, const Path &rhs) |
bool | operator> (const Path &lhs, const Path &rhs) |
bool | operator>= (const Path &lhs, const Path &rhs) |
bool | is_odirect_aligned (uint64_t value) |
bool | is_odirect_aligned (const void *ptr) |
std::ostream & | operator<< (std::ostream &o, const DirectIoFile &v) |
std::ostream & | operator<< (std::ostream &o, const SpaceInfo &v) |
std::ostream & | operator<< (std::ostream &o, const Path &v) |
Variables | |
const uint64_t | kOdirectAlignment = 0x1000 |
|
inline |
Definition at line 37 of file direct_io_file.cpp.
Referenced by foedus::fs::DirectIoFile::read(), foedus::fs::DirectIoFile::read_raw(), foedus::fs::DirectIoFile::seek(), foedus::fs::DirectIoFile::truncate(), foedus::fs::DirectIoFile::write(), and foedus::fs::DirectIoFile::write_raw().
|
inline |
Definition at line 40 of file direct_io_file.cpp.
Definition at line 89 of file path.hpp.
References foedus::fs::Path::compare().
|
inline |
Definition at line 90 of file path.hpp.
References foedus::fs::Path::compare().
|
inline |
Definition at line 91 of file path.hpp.
References foedus::fs::Path::compare().
Definition at line 93 of file path.hpp.
References foedus::fs::Path::compare().
std::ostream& foedus::fs::operator<< | ( | std::ostream & | o, |
const Path & | v | ||
) |
Definition at line 84 of file path.cpp.
References foedus::fs::Path::string().
std::ostream& foedus::fs::operator<< | ( | std::ostream & | o, |
const SpaceInfo & | v | ||
) |
Definition at line 193 of file filesystem.cpp.
References foedus::fs::SpaceInfo::available_, foedus::fs::SpaceInfo::capacity_, and foedus::fs::SpaceInfo::free_.
std::ostream& foedus::fs::operator<< | ( | std::ostream & | o, |
const DirectIoFile & | v | ||
) |
Definition at line 388 of file direct_io_file.cpp.
References foedus::fs::DirectIoFile::get_current_offset(), foedus::fs::DirectIoFile::get_descriptor(), foedus::fs::DirectIoFile::get_path(), foedus::fs::DirectIoFile::is_read(), and foedus::fs::DirectIoFile::is_write().
Definition at line 85 of file path.hpp.
References foedus::fs::Path::compare().
|
inline |
Definition at line 86 of file path.hpp.
References foedus::fs::Path::compare().
|
inline |
Definition at line 87 of file path.hpp.
References foedus::fs::Path::compare().
const uint64_t foedus::fs::kOdirectAlignment = 0x1000 |
Definition at line 36 of file direct_io_file.cpp.