eckit::TempFile 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

TempFile()
TempFile(const std::string&)
~TempFile()
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::TempFile::unique(const PathName&)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

What type of PathName object is this.

PathName eckit::TempFile::dirName() const

Returns directory part of the path

Directory part of the path

PathName eckit::TempFile::fullName() const

Returns absolute path

Absolute path

PathName eckit::TempFile::clusterName() const

PathName eckit::TempFile::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::TempFile::extension() const

Returns file extension (empty string if there is none)

path extension

bool eckit::TempFile::exists() const

Returns true if the path exists

Check if path exists

bool eckit::TempFile::available() const

Returns true (local paths are always available)

Check if path is available

bool eckit::TempFile::offsite() const

Check if path is offsite.

void eckit::TempFile::touch() const

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

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

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

Length eckit::TempFile::size() const

Returns Size in Bytes

File size

time_t eckit::TempFile::lastAccess() const

Returns Time of last access

Last access time

time_t eckit::TempFile::lastModified() const

Returns Time of last modification

Last modification time

time_t eckit::TempFile::created() const

Returns Time of creation

Creation time

uid_t eckit::TempFile::owner() const

Returns Owner ID

File owner

bool eckit::TempFile::isDir() const

Returns true if the path is a directory

Check if path is a directory

bool eckit::TempFile::isLink() const

Returns true if the path is a symlink

Check if path is a symlink

void eckit::TempFile::empty() const

Clear the file.

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

Truncate the file to given number of Bytes.

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

Parameters
mode file mode bits

Create the directory and all directories leading to it with given mode

void eckit::TempFile::chmod(const FileMode& mode) const

Parameters
mode file mode bits

Change the file mode

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

Unlink the path.

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

Remove the directory.

void eckit::TempFile::syncParentDirectory() const

Synchronise the parent directory entries to persistent storage.

void eckit::TempFile::backup() const

Create a copy with a unique path name.

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

Create a copy with the given path name.

bool eckit::TempFile::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::TempFile::mountPoint() const

Returns mount point of path

Mount point of the path

PathName eckit::TempFile::realName() const

Returns the real path (with symlinks resolved)

Real path (with symlinks resolved)

PathName eckit::TempFile::orphanName() const

PathName eckit::TempFile::checkClusterNode() const

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

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

Returns string representation of path

String representation

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

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

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

Hash a path as in-place as possible. Returns the hash digest.

void eckit::TempFile::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::TempFile::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::TempFile::fileSystemSize(FileSystemSize&) const

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

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

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