69bool _vfsMountProvider(_Inout_
VFS* vfs, _Inout_
ObjInst* provider, _In_opt_ strref path,
90#define vfsMountProvider(vfs, provider, path, ...) \
91 _vfsMountProvider(vfs, objInstBase(provider), path, opt_flags(__VA_ARGS__))
93bool _vfsMountFS(_Inout_
VFS* vfs, _In_opt_ strref path, _In_opt_ strref fsroot, flags_t flags);
115#define vfsMountFS(vfs, path, fsroot, ...) _vfsMountFS(vfs, path, fsroot, opt_flags(__VA_ARGS__))
117bool _vfsMountVFS(_Inout_
VFS* vfs, _In_opt_ strref path, _Inout_
VFS* vfs2,
118 _In_opt_ strref vfs2root, flags_t flags);
142#define vfsMountVFS(vfs, path, vfs2, vfs2root, ...) \
143 _vfsMountVFS(vfs, path, vfs2, vfs2root, opt_flags(__VA_ARGS__))
165#define VFS_CACHE_MAXDIRS 4096
167#define VFS_CACHE_TTL timeS(300)
208#define _vfsStatAnno _Success_(return != FS_Nonexistent)
261bool vfsSetTimes(_Inout_
VFS* vfs, _In_opt_ strref path, int64 modified, int64 accessed);
311bool vfsCopy(_Inout_
VFS* vfs, _In_opt_ strref from, _In_opt_ strref to);
323bool vfsRename(_Inout_
VFS* vfs, _In_opt_ strref from, _In_opt_ strref to);
360 _In_opt_ strref pattern,
int typefilter,
bool stat);
382 return iter->_search;
409_meta_inline
bool vfsRead(_Inout_
VFSFile* file, _Out_writes_bytes_to_(sz, *bytesread)
void* buf,
410 size_t sz, _Out_ _Deref_out_range_(0, sz)
size_t* bytesread)
416 return fileRead(file, buf, sz, bytesread);
429_meta_inline
bool vfsWrite(_Inout_
VFSFile* file, _In_reads_bytes_(sz)
const void* buf,
size_t sz,
430 _Out_opt_ _Deref_out_range_(0, sz)
size_t* byteswritten)
437 return fileWrite(file, buf, sz, byteswritten);
450 _Out_opt_
size_t* byteswritten)
483 return fileSeek(file, off, seektype);
Low-level file I/O operations.
Platform-specific filesystem operations.
#define fileRead(self, buf, sz, bytesread)
#define fileSeek(self, off, seektype)
#define fileWrite(self, buf, sz, byteswritten)
#define fileWriteString(self, str, byteswritten)
enum FSSeekTypeEnum FSSeekType
enum FSPathStatEnum FSPathStat
@ FS_Directory
Path is a directory.
@ FS_File
Path is a regular file.
@ FS_Nonexistent
Path does not exist.
bool vfsSearchValid(FSSearchIter *iter)
void vfsCurDir(VFS *vfs, string *out)
bool vfsSearchInit(FSSearchIter *iter, VFS *vfs, strref path, strref pattern, int typefilter, bool stat)
bool vfsCreateAll(VFS *vfs, strref path)
void vfsSearchFinish(FSSearchIter *iter)
bool vfsDelete(VFS *vfs, strref path)
FSPathStat vfsStat(VFS *vfs, strref path, FSStat *stat)
bool vfsIsDir(VFS *vfs, strref path)
bool vfsSearchNext(FSSearchIter *iter)
bool vfsFlush(VFSFile *file)
bool vfsRemoveDir(VFS *vfs, strref path)
void vfsDestroy(VFS **pvfs)
VFSFile * vfsOpen(VFS *vfs, strref path, flags_t flags)
bool vfsUnmount(VFS *vfs, strref path)
void vfsSetCacheLimits(VFS *vfs, uint32 maxdirs, int64 ttl)
bool vfsWriteString(VFSFile *file, strref str, size_t *byteswritten)
bool vfsExist(VFS *vfs, strref path)
void vfsAbsolutePath(VFS *vfs, string *out, strref path)
int64 vfsSeek(VFSFile *file, int64 off, FSSeekType seektype)
bool vfsCopy(VFS *vfs, strref from, strref to)
bool vfsCreateDir(VFS *vfs, strref path)
bool vfsRead(VFSFile *file, void *buf, size_t sz, size_t *bytesread)
bool vfsGetFSPath(string *out, VFS *vfs, strref path)
bool vfsSetTimes(VFS *vfs, strref path, int64 modified, int64 accessed)
void vfsPruneCache(VFS *vfs)
bool vfsSetCurDir(VFS *vfs, strref cur)
bool vfsRename(VFS *vfs, strref from, strref to)
bool vfsWrite(VFSFile *file, const void *buf, size_t sz, size_t *byteswritten)
bool vfsIsFile(VFS *vfs, strref path)
int64 vfsTell(VFSFile *file)
FSStat stat
File metadata (only valid if stat=true in fsSearchInit)
Time manipulation and conversion functions.