std1.0.0-beta-7 SafeC docs

std :: fs::vfs

Struct std::Vfs

#include <std/fs/vfs.h> source

struct Vfs {
    struct VfsMount mounts[VFS_MAX_MOUNTS];
    int mount_count;
}

Fields

§int mount_countsource

Methods

§generic<F: FileSystem> int mount(const &char mountpoint, &F fs)source · definition

Mount fs at mountpoint (e.g. "/" or "/tmp"). 0 on success, -1 if every mount slot is taken. fs must outlive the mount.

§generic<F: FsRead> int mount_ro(const &char mountpoint, &F fs)source · definition

Read-only: write, unlink and mkdir through this mount fail.

§int unmount(const &char mountpoint)source · definition

Unmount filesystem at mountpoint.

§int open(const &char path, int flags, &VfsNode node_out)source · definition

Open path; fills node_out. Returns 0 on success.

§int mkdir(const &char path)source · definition

Create a directory.