class
#include <eckit/filesystem/PathName.h>
PathName
Derived classes
Public static functions
- static auto unique(const PathName&) -> PathName
-
static void match(const PathName&,
std::
vector<PathName>&, bool = false) - static void link(const PathName& from, const PathName& to)
- static void rename(const PathName& from, const PathName& to)
-
static void rename(const PathName& from,
const std::
string& newBase) -
static auto shorten(const std::
string&) -> std:: string -
static auto metricsTag(const std::
string&) -> std:: string
Constructors, destructors, conversion operators
- PathName(const char* p = "/", bool tildeIsUserHome = false)
-
PathName(const std::
string& p, bool tildeIsUserHome = false) -
PathName(const std::
string& type, const std:: string& p, bool tildeIsUserHome = false) - PathName(const PathName& p)
- PathName(const LocalPathName&)
- ~PathName()
- operator std::string() const
Public functions
- auto operator=(const PathName& p) -> PathName&
-
auto operator=(const std::
string& p) -> PathName& - auto operator=(const char* p) -> PathName&
-
auto asString() const -> std::
string - auto localPath() const -> const char*
-
auto operator+=(const std::
string& s) -> PathName& - auto operator+=(const char* s) -> PathName&
- auto operator+=(char s) -> PathName&
-
auto operator/=(const std::
string& s) -> PathName& - auto operator/=(const char* s) -> PathName&
- auto operator/=(char s) -> PathName&
- auto operator<(const PathName& other) const -> bool
- auto operator>(const PathName& other) const -> bool
- auto operator<=(const PathName& other) const -> bool
- auto operator>=(const PathName& other) const -> bool
- auto operator!=(const PathName& other) const -> bool
- auto operator==(const PathName& other) const -> bool
- auto type() const -> const char*
- What type of PathName object is this.
- auto dirName() const -> PathName
- auto fullName() const -> PathName
- auto clusterName() const -> PathName
- auto baseName(bool ext = true) const -> PathName
-
auto extension() const -> std::
string - auto exists() const -> bool
- auto available() const -> bool
- auto offsite() const -> bool
- Check if path is offsite.
- void touch() const
- Touch the path. The path leading to it is created if it does not exist.
- void reserve(const Length&) const
- auto size() const -> Length
- auto lastAccess() const -> time_t
- auto lastModified() const -> time_t
- auto created() const -> time_t
- auto owner() const -> uid_t
- auto isDir() const -> bool
- auto isLink() const -> bool
- void empty() const
- Clear the file.
- void truncate(Length) const
- void mkdir(short mode = 0777) const
- void chmod(const FileMode& mode) const
- void unlink(bool verbose = true) const
- Unlink the path.
- void rmdir(bool verbose = true) const
- Remove the directory.
- void syncParentDirectory() const
- Synchronise the parent directory entries to persistent storage.
- void backup() const
- Create a copy with a unique path name.
- void copy(const PathName&) const
- Create a copy with the given path name.
- auto sameAs(const PathName&) const -> bool
- auto mountPoint() const -> PathName
- auto realName() const -> PathName
- auto orphanName() const -> PathName
- auto checkClusterNode() const -> PathName
-
auto node() const -> const std::
string& -
auto path() const -> const std::
string& - void hash(Hash&) const
- Hash the contents of this pathname (only valid for files)
-
auto hash(const std::
string& method = "xxh64") const -> std:: string - Hash a path as in-place as possible. Returns the hash digest.
-
void children(std::
vector<PathName>& files, std:: vector<PathName>& dirs) const -
void childrenRecursive(std::
vector<PathName>& files, std:: vector<PathName>& dirs) const - void fileSystemSize(FileSystemSize&) const
- auto fileHandle(bool overwrite = false) const -> DataHandle*
- auto partHandle(const OffsetList&, const LengthList&) const -> DataHandle*
- auto partHandle(const Offset&, const Length&) const -> DataHandle*
Friends
- void operator<<(Stream&, const PathName&)
- void operator>>(Stream&, PathName&)
-
auto operator<<(std::
ostream& s, const PathName& p) -> std:: ostream& -
auto operator+(const PathName& p,
const std::
string& s) -> PathName - auto operator+(const PathName& p, const char* s) -> PathName
- auto operator+(const PathName& p, char s) -> PathName
-
auto operator/(const PathName& p,
const std::
string& s) -> PathName - auto operator/(const PathName& p, const char* s) -> PathName
- auto operator/(const PathName& p, char s) -> PathName
Function documentation
std:: string eckit:: PathName:: extension() const
Returns | file extension (empty string if there is none) |
---|
path extension
bool eckit:: PathName:: available() const
Returns | true (local paths are always available) |
---|
Check if path is available
time_t eckit:: PathName:: lastModified() const
Returns | Time of last modification |
---|
Last modification time
bool eckit:: PathName:: isDir() const
Returns | true if the path is a directory |
---|
Check if path is a directory
bool eckit:: PathName:: isLink() const
Returns | true if the path is a symlink |
---|
Check if path is a symlink
void eckit:: PathName:: mkdir(short mode = 0777) const
Parameters | |
---|---|
mode | file mode bits |
Create the directory and all directories leading to it with given mode
const std:: string& eckit:: PathName:: path() const
Returns | string representation of path |
---|
String representation
void eckit:: PathName:: children(std:: vector<PathName>& files,
std:: vector<PathName>& dirs) const
Parameters | |
---|---|
files | vector to be filled with child files of path |
dirs |
Get child files and directories
void eckit:: PathName:: childrenRecursive(std:: vector<PathName>& files,
std:: vector<PathName>& dirs) const
Parameters | |
---|---|
files | vector to be filled with child files of path |
dirs |
Get child files and directories descending recursively on all sub directories