apfs::volume

class volume

Represents a volume within an APFS container.

A single APFS partition may contain multiple volumes, each with its own filesystem hierarchy. macOS, for example, mounts and presents these volumes separately.

To obtain a volume, use partition.

Public Functions

directory_entry root() const

Return a directory_entry that points to the root of the filesystem.

directory_entry navigate_to(const std::string &path, bool follow_last = true) const

Navigate to a given directory relative to the root of the filesystem.

Equivalent to root().resolve(path).

Parameters:
bool follow_last = true

Controls whether or not you want to follow the last (possible) symlink.

Public Members

std::string name

The volume’s name.

uint64_t size

The size, in bytes, occupied by this volume.

Dynamically grows because, unlike other filesystems, the maximum capacity of an APFS volume is the size of the partition it’s a part of.