class
#include <eckit/filesystem/TmpFile.h>
TmpFile
Base classes
- class PathName
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
- TmpFile(bool verbose = true)
- ~TmpFile()
- operator std::string() const
Public functions
-
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*
Function documentation
static PathName eckit:: TmpFile:: unique(const PathName&)
#include <eckit/filesystem/PathName.h>
static void eckit:: TmpFile:: match(const PathName&,
std:: vector<PathName>&,
bool = false)
#include <eckit/filesystem/PathName.h>
static void eckit:: TmpFile:: link(const PathName& from,
const PathName& to)
#include <eckit/filesystem/PathName.h>
static void eckit:: TmpFile:: rename(const PathName& from,
const PathName& to)
#include <eckit/filesystem/PathName.h>
static void eckit:: TmpFile:: rename(const PathName& from,
const std:: string& newBase)
#include <eckit/filesystem/PathName.h>
static std:: string eckit:: TmpFile:: shorten(const std:: string&)
#include <eckit/filesystem/PathName.h>
static std:: string eckit:: TmpFile:: metricsTag(const std:: string&)
#include <eckit/filesystem/PathName.h>
eckit:: TmpFile:: operator std::string() const
#include <eckit/filesystem/PathName.h>
std:: string eckit:: TmpFile:: asString() const
#include <eckit/filesystem/PathName.h>
const char* eckit:: TmpFile:: localPath() const
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator+=(const std:: string& s)
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator+=(const char* s)
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator+=(char s)
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator/=(const std:: string& s)
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator/=(const char* s)
#include <eckit/filesystem/PathName.h>
PathName& eckit:: TmpFile:: operator/=(char s)
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator<(const PathName& other) const
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator>(const PathName& other) const
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator<=(const PathName& other) const
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator>=(const PathName& other) const
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator!=(const PathName& other) const
#include <eckit/filesystem/PathName.h>
bool eckit:: TmpFile:: operator==(const PathName& other) const
#include <eckit/filesystem/PathName.h>
const char* eckit:: TmpFile:: type() const
#include <eckit/filesystem/PathName.h>
What type of PathName object is this.
PathName eckit:: TmpFile:: dirName() const
#include <eckit/filesystem/PathName.h>
Returns | directory part of the path |
---|
Directory part of the path
PathName eckit:: TmpFile:: fullName() const
#include <eckit/filesystem/PathName.h>
Returns | absolute path |
---|
Absolute path
PathName eckit:: TmpFile:: clusterName() const
#include <eckit/filesystem/PathName.h>
PathName eckit:: TmpFile:: baseName(bool ext = true) const
#include <eckit/filesystem/PathName.h>
Parameters | |
---|---|
ext | if false the extension is stripped |
Returns | the name part of the path |
Base name of the path
std:: string eckit:: TmpFile:: extension() const
#include <eckit/filesystem/PathName.h>
Returns | file extension (empty string if there is none) |
---|
path extension
bool eckit:: TmpFile:: exists() const
#include <eckit/filesystem/PathName.h>
Returns | true if the path exists |
---|
Check if path exists
bool eckit:: TmpFile:: available() const
#include <eckit/filesystem/PathName.h>
Returns | true (local paths are always available) |
---|
Check if path is available
bool eckit:: TmpFile:: offsite() const
#include <eckit/filesystem/PathName.h>
Check if path is offsite.
void eckit:: TmpFile:: touch() const
#include <eckit/filesystem/PathName.h>
Touch the path. The path leading to it is created if it does not exist.
void eckit:: TmpFile:: reserve(const Length&) const
#include <eckit/filesystem/PathName.h>
Reserve a given number of Bytes (file must be of length 0 or not exist)
Length eckit:: TmpFile:: size() const
#include <eckit/filesystem/PathName.h>
Returns | Size in Bytes |
---|
File size
time_t eckit:: TmpFile:: lastAccess() const
#include <eckit/filesystem/PathName.h>
Returns | Time of last access |
---|
Last access time
time_t eckit:: TmpFile:: lastModified() const
#include <eckit/filesystem/PathName.h>
Returns | Time of last modification |
---|
Last modification time
time_t eckit:: TmpFile:: created() const
#include <eckit/filesystem/PathName.h>
Returns | Time of creation |
---|
Creation time
uid_t eckit:: TmpFile:: owner() const
#include <eckit/filesystem/PathName.h>
Returns | Owner ID |
---|
File owner
bool eckit:: TmpFile:: isDir() const
#include <eckit/filesystem/PathName.h>
Returns | true if the path is a directory |
---|
Check if path is a directory
bool eckit:: TmpFile:: isLink() const
#include <eckit/filesystem/PathName.h>
Returns | true if the path is a symlink |
---|
Check if path is a symlink
void eckit:: TmpFile:: empty() const
#include <eckit/filesystem/PathName.h>
Clear the file.
void eckit:: TmpFile:: truncate(Length) const
#include <eckit/filesystem/PathName.h>
Truncate the file to given number of Bytes.
void eckit:: TmpFile:: mkdir(short mode = 0777) const
#include <eckit/filesystem/PathName.h>
Parameters | |
---|---|
mode | file mode bits |
Create the directory and all directories leading to it with given mode
void eckit:: TmpFile:: chmod(const FileMode& mode) const
#include <eckit/filesystem/PathName.h>
Parameters | |
---|---|
mode | file mode bits |
Change the file mode
void eckit:: TmpFile:: unlink(bool verbose = true) const
#include <eckit/filesystem/PathName.h>
Unlink the path.
void eckit:: TmpFile:: rmdir(bool verbose = true) const
#include <eckit/filesystem/PathName.h>
Remove the directory.
void eckit:: TmpFile:: syncParentDirectory() const
#include <eckit/filesystem/PathName.h>
Synchronise the parent directory entries to persistent storage.
void eckit:: TmpFile:: backup() const
#include <eckit/filesystem/PathName.h>
Create a copy with a unique path name.
void eckit:: TmpFile:: copy(const PathName&) const
#include <eckit/filesystem/PathName.h>
Create a copy with the given path name.
bool eckit:: TmpFile:: sameAs(const PathName&) const
#include <eckit/filesystem/PathName.h>
Returns | true if the path points to the same inode as the given path |
---|
Check if a given path points to the same inode as this path
PathName eckit:: TmpFile:: mountPoint() const
#include <eckit/filesystem/PathName.h>
Returns | mount point of path |
---|
Mount point of the path
PathName eckit:: TmpFile:: realName() const
#include <eckit/filesystem/PathName.h>
Returns | the real path (with symlinks resolved) |
---|
Real path (with symlinks resolved)
PathName eckit:: TmpFile:: orphanName() const
#include <eckit/filesystem/PathName.h>
PathName eckit:: TmpFile:: checkClusterNode() const
#include <eckit/filesystem/PathName.h>
const std:: string& eckit:: TmpFile:: node() const
#include <eckit/filesystem/PathName.h>
const std:: string& eckit:: TmpFile:: path() const
#include <eckit/filesystem/PathName.h>
Returns | string representation of path |
---|
String representation
void eckit:: TmpFile:: hash(Hash&) const
#include <eckit/filesystem/PathName.h>
Hash the contents of this pathname (only valid for files)
std:: string eckit:: TmpFile:: hash(const std:: string& method = "xxh64") const
#include <eckit/filesystem/PathName.h>
Hash a path as in-place as possible. Returns the hash digest.
void eckit:: TmpFile:: children(std:: vector<PathName>& files,
std:: vector<PathName>& dirs) const
#include <eckit/filesystem/PathName.h>
Parameters | |
---|---|
files | vector to be filled with child files of path |
dirs |
Get child files and directories
void eckit:: TmpFile:: childrenRecursive(std:: vector<PathName>& files,
std:: vector<PathName>& dirs) const
#include <eckit/filesystem/PathName.h>
Parameters | |
---|---|
files | vector to be filled with child files of path |
dirs |
Get child files and directories descending recursively on all sub directories
void eckit:: TmpFile:: fileSystemSize(FileSystemSize&) const
#include <eckit/filesystem/PathName.h>
DataHandle* eckit:: TmpFile:: fileHandle(bool overwrite = false) const
#include <eckit/filesystem/PathName.h>
DataHandle* eckit:: TmpFile:: partHandle(const OffsetList&,
const LengthList&) const
#include <eckit/filesystem/PathName.h>
DataHandle* eckit:: TmpFile:: partHandle(const Offset&,
const Length&) const
#include <eckit/filesystem/PathName.h>