std1.0.0-beta-7 SafeC docs

std :: fs::vfs

Trait std::FsRead

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

trait FsRead {
    int open(const &char path, int flags, &VfsNode node_out);
    unsigned long read(unsigned long inode, unsigned long offset, []unsigned char buf);
    int readdir(unsigned long inode, fn void(&VfsNode, ?&Erased) cb, ?&Erased user);
}

Required methods

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

Looks up path (VFS_O_CREATE: creates a missing file) and fills node_out's name, type, size and inode. 0 on success.

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

Up to buf.len bytes of file inode from offset; returns the count read.

§int readdir(unsigned long inode, fn void(&VfsNode, ?&Erased) cb, ?&Erased user)source

cb(entry, user) per child of directory inode; the entry count, or -1. Drivers declare it generic<T>: (fn void(&VfsNode, ?&T), ?&T).