tostc / cvfs Goto Github PK
View Code? Open in Web Editor NEWA simple node based virtual file system, written in pure C++ 11.
License: MIT License
A simple node based virtual file system, written in pure C++ 11.
License: MIT License
Hi There!
I have implemented a function to deserialize a filesystem created with Serialize...
// deserialize show file
bool LoadFileSystem(std::string FileName = "")
{
if (FileName.size() == 0)
FileName = "last.fs";
ifstream in(FileName, ios::in | ios::binary);
if (in.is_open())
{
in.seekg(0, std::ios::end);
std::streampos length = in.tellg();
in.seekg(0, std::ios::beg);
std::vector<char> buffer(length);
in.read(&buffer[0], length);
in.close();
try
{
g_VFS.Deserialize(buffer);
}
catch (VFS::CVFSException e)
{
// spdlog::error("Failed to deserialize: '{}' -> {}",FileName, e.what());
return false;
}
return true;
}
// spdlog::error("Could not open file: {}", FileName);
return false;
}
This is working, but say create some default directories, eg "/sys", I save the file system, then load a file system, I have now in PrintDirs two "/sys" folders.
Is there a simple way to merge or overlay these?
Also is there a better way to load, so I don't load the entire thing into memory here when loading? I couldn't really think of one.
Cheers,
Hi there!
a) Does support nested directories, ie: /tmp/tmpdir/file.txt ?
Seems not, but possible to implement? Like nest a VFS in a file, inside a directory?
b) Does support binary files ?
How to get size?
Cheers,
Hippy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.