VFS
Virtual file system (VFS) module provides a virtual and uniform file system across all platforms, so that the user can use one uniform path and API to open one file on all platforms without caring where the file is actually in. VFS supports user-implemented file system drivers and devices, which allows the file system to be extended to support reading files from zip archives, online server, etc.
Topics
Types
-
Describes one virtual file system (VFS) driver.
Functions
-
void register_driver(const Name &name, const DriverDesc &desc)
Registers one new VFS driver to the system.
-
Mounts one virtual file device as one directory in the virtual file system.
-
RV unmount(const Path &mount_path)
Unmounts the virtual file device in the mounting directory.
-
RV remount(const Path &from_path, const Path &to_path)
Changes the mounting directory of the file device.
-
R< Ref< IFile > > open_file(const Path &path, FileOpenFlag flags, FileCreationMode creation)
Opens one file.
-
R< FileAttribute > get_file_attribute(const Path &path)
Gets the file or directory attribute.
-
RV copy_file(const Path &from_path, const Path &to_path, FileCopyFlag flags=FileCopyFlag::none)
Copies the file or directory from the source path to the destination path.
-
RV move_file(const Path &from_path, const Path &to_path, FileMoveFlag flags=FileMoveFlag::none)
Moves the file or directory from the source path to the destination path. This call can also be used to rename a file.
-
RV delete_file(const Path &path)
Deletes the specified file.
-
R< Ref< IFileIterator > > open_dir(const Path &path)
Creates a file iterator that can be used to iterate all files in the specified directory.
-
RV create_dir(const Path &path)
Creates one directory.
-
R< Name > get_native_path(const Path &vfs_path)
Translates one VFS path to one native driver path.
-
Name get_platform_filesystem_driver()
Gets the name of the VFS driver that maps platform's native file system to vritual file system.