std1.0.0-beta-7 SafeC docs

std :: fs::vfs

Struct std::VfsNode

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

struct VfsNode {
    char name[VFS_MAX_NAME];
    int type;
    unsigned long size;
    unsigned long inode;
    ?&struct VfsMount fs_ctx;
}

Fields

§int typesource

VFS_TYPE_FILE / VFS_TYPE_DIR

§unsigned long sizesource

file size in bytes (0 for dirs)

§unsigned long inodesource

driver-specific inode number

§?&struct VfsMount fs_ctxsource

driver-internal: the owning VfsMount

Methods

§unsigned long read(unsigned long offset, []unsigned char buf)source · definition

Reads up to buf.len bytes of the file at offset into buf. Returns bytes read.

§unsigned long write(unsigned long offset, []const unsigned char buf)source · definition

Writes buf to the file at offset. Returns bytes written.

§generic<T> int readdir(fn void(&VfsNode, &T) cb, &T user)source · definition

Calls cb(entry, user) for each child of this directory. Returns the entry count, or -1 on error.