Implement a Virtual File System #5
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#2 Implement the Core}
Atlas/Atlas-Launcher
Reference: Atlas/Atlas-Launcher#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Virtual File System
Our patching system require to allow a modder to access the game files alongside the assets inside their mod so that he can apply his modifications.
To prevent the modder from accessing hosts files, it would be preferable to use a virtual file system instead of a real one on which the required files will be mounted.
The path of this file system shall follow the same syntax as the standard UNIX ones, starting at the "/" root on which required directories could be mounted as "/games/" or "/assets/".
Using a path outside of a mounted directories shall either create temporary files that will be deleted once the engine is freed, or should raise an exception. Alternatively, a "/tmp/" directory could be mounted on which theses files could be accessed.
tiny-vfs
tiny-vfs is a very small project aiming to implement a virtual file system. Sadly, it seem way too rudimentary to be usable for this project.
vfspp
vfspp is a small project aiming to implement this kinds of virtual file system.
Sadly, it does not implement any kind of directory exploration, only file manipulation.
cppfs
cppfs is a library specialized in the manipulation of the file system, a kind of alternative to the standard
std::filesystem
C++ library. Its capacities to implement a virtual file system seem a bit off our goal for this project.FUSE
FUSE is a linux feature allowing for overwriting the filesystem calls. It is a very low level feature that require the implementation of multiple functions to replace the base comportment of the kernel.
This feature seem very complex to implement and can only seem to support a single FUSE running at the same time. For future optimisation and multitasking reason, I would prefer a virtual file system that could be instantiated as much as required at the same time.
Custom
A custom virtual file system library have instead be implemented for the Atlas launcher : it create a temporary folder on which others directories can be mounted by creating symlinks. Path can be virtual or real : a virtual path being in the virtual file system, and a real one being in the host file system. The script language will only manipulate virtual paths while the engine will resolve them into their real path to use them. It is programmed so that path outside of the virtual file system cannot be accessed, it is not possible to use syntax such as "/", "." or ".." to escape this security.
While very rudimentary, this implementation seem incredibly simple and efficient. Further security tests shall be needed to guarantee there is no way to escape the sand-boxing.