std1.0.0-beta-7 SafeC docs

std :: fs::vfs

Struct std::VfsOps

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

struct VfsOps {
    ?fn int(&Erased ctx, const &char path, int flags, &VfsNode node_out) open;
    ?fn int(&Erased ctx, const &char path) unlink;
    ?fn int(&Erased ctx, const &char path) mkdir;
    ?fn unsigned long(
    &Erased ctx,
    unsigned long inode,
    unsigned long off,
    []unsigned char buf,
) read;
    ?fn unsigned long(
    &Erased ctx,
    unsigned long inode,
    unsigned long off,
    []const unsigned char buf,
) write;
    ?fn int(
    &Erased ctx,
    unsigned long inode,
    fn void(&VfsNode, ?&Erased) cb,
    ?&Erased user,
) readdir;
}

The mounted driver's entry points, type-erased so one Vfs holds drivers of different context types. Built by Vfs::mount / mount_ro; a null entry (a read-only mount's write/unlink/mkdir) makes that call fail. (See std/erased.h: ctx is the driver's &F.)

Fields

§?fn int(&Erased ctx, const &char path, int flags, &VfsNode node_out) opensource
§?fn int(&Erased ctx, const &char path) mkdirsource
§?fn unsigned long( &Erased ctx, unsigned long inode, unsigned long off, []unsigned char buf, ) readsource
§?fn unsigned long( &Erased ctx, unsigned long inode, unsigned long off, []const unsigned char buf, ) writesource
§?fn int( &Erased ctx, unsigned long inode, fn void(&VfsNode, ?&Erased) cb, ?&Erased user, ) readdirsource