eckit::TmpFile class

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&)

static void eckit::TmpFile::match(const PathName&, std::vector<PathName>&, bool = false)

static void eckit::TmpFile::link(const PathName& from, const PathName& to)

static void eckit::TmpFile::rename(const PathName& from, const PathName& to)

static void eckit::TmpFile::rename(const PathName& from, const std::string& newBase)

static std::string eckit::TmpFile::shorten(const std::string&)

static std::string eckit::TmpFile::metricsTag(const std::string&)

eckit::TmpFile::operator std::string() const

std::string eckit::TmpFile::asString() const

const char* eckit::TmpFile::localPath() const

PathName& eckit::TmpFile::operator+=(const std::string& s)

PathName& eckit::TmpFile::operator+=(const char* s)

PathName& eckit::TmpFile::operator+=(char s)

PathName& eckit::TmpFile::operator/=(const std::string& s)

PathName& eckit::TmpFile::operator/=(const char* s)

PathName& eckit::TmpFile::operator/=(char s)

bool eckit::TmpFile::operator<(const PathName& other) const

bool eckit::TmpFile::operator>(const PathName& other) const

bool eckit::TmpFile::operator<=(const PathName& other) const

bool eckit::TmpFile::operator>=(const PathName& other) const

bool eckit::TmpFile::operator!=(const PathName& other) const

bool eckit::TmpFile::operator==(const PathName& other) const

const char* eckit::TmpFile::type() const

What type of PathName object is this.

PathName eckit::TmpFile::dirName() const

Returns directory part of the path

Directory part of the path

PathName eckit::TmpFile::fullName() const

Returns absolute path

Absolute path

PathName eckit::TmpFile::clusterName() const

PathName eckit::TmpFile::baseName(bool ext = true) const

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

Returns file extension (empty string if there is none)

path extension

bool eckit::TmpFile::exists() const

Returns true if the path exists

Check if path exists

bool eckit::TmpFile::available() const

Returns true (local paths are always available)

Check if path is available

bool eckit::TmpFile::offsite() const

Check if path is offsite.

void eckit::TmpFile::touch() const

Touch the path. The path leading to it is created if it does not exist.

void eckit::TmpFile::reserve(const Length&) const

Reserve a given number of Bytes (file must be of length 0 or not exist)

Length eckit::TmpFile::size() const

Returns Size in Bytes

File size

time_t eckit::TmpFile::lastAccess() const

Returns Time of last access

Last access time

time_t eckit::TmpFile::lastModified() const

Returns Time of last modification

Last modification time

time_t eckit::TmpFile::created() const

Returns Time of creation

Creation time

uid_t eckit::TmpFile::owner() const

Returns Owner ID

File owner

bool eckit::TmpFile::isDir() const

Returns true if the path is a directory

Check if path is a directory

bool eckit::TmpFile::isLink() const

Returns true if the path is a symlink

Check if path is a symlink

void eckit::TmpFile::empty() const

Clear the file.

void eckit::TmpFile::truncate(Length) const

Truncate the file to given number of Bytes.

void eckit::TmpFile::mkdir(short mode = 0777) const

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

Parameters
mode file mode bits

Change the file mode

void eckit::TmpFile::unlink(bool verbose = true) const

Unlink the path.

void eckit::TmpFile::rmdir(bool verbose = true) const

Remove the directory.

void eckit::TmpFile::syncParentDirectory() const

Synchronise the parent directory entries to persistent storage.

void eckit::TmpFile::backup() const

Create a copy with a unique path name.

void eckit::TmpFile::copy(const PathName&) const

Create a copy with the given path name.

bool eckit::TmpFile::sameAs(const PathName&) const

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

Returns mount point of path

Mount point of the path

PathName eckit::TmpFile::realName() const

Returns the real path (with symlinks resolved)

Real path (with symlinks resolved)

PathName eckit::TmpFile::orphanName() const

PathName eckit::TmpFile::checkClusterNode() const

const std::string& eckit::TmpFile::node() const

const std::string& eckit::TmpFile::path() const

Returns string representation of path

String representation

void eckit::TmpFile::hash(Hash&) const

Hash the contents of this pathname (only valid for files)

std::string eckit::TmpFile::hash(const std::string& method = "xxh64") const

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

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

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

DataHandle* eckit::TmpFile::fileHandle(bool overwrite = false) const

DataHandle* eckit::TmpFile::partHandle(const OffsetList&, const LengthList&) const

DataHandle* eckit::TmpFile::partHandle(const Offset&, const Length&) const