Git Product home page Git Product logo

cvfs's People

Contributors

tostc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cvfs's Issues

Deserialize: Merging

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,

Quick Questions for the readme.md

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.