C++/C 虚拟/可嵌入文件系统 [交叉兼容(库)]
C++/C Virtual/Embeddable File System [Cross Compatible (Library)]?
我想尝试一些虚拟文件系统,例如拥有 1 个存储所有数据的文件(1 个文件 = 虚拟磁盘)。例如,我可以打开虚拟磁盘并将文件放入其中,将数据写入文件,从文件中读取数据,打开文件并使用fseek等。
有没有我可以使用的库?许可证等并不重要。我只是想在我的机器上测试它,因为我很无聊,所以我想在 C++/C 中尝试这个。
提前感谢! :)
如果库只是 windows,那也没关系,也许我会找到一个 linux 库,这样我就可以制作 2 个项目?
编辑:感谢BRPocock,我知道我的问题有点不清楚。我真正想要的是一个能够在库已经提供的 VFS 上存储文件、读取文件和执行文件操作的库。当然还有安装。所以,如果有一个库可以在C++中为我提供此功能,我会说:
OpenVirtualDrive(const name[]);//
CloseVirtualDrive(handle);//
fopen(const name[], mode);//open file, return handle
fclose(handle);//close handle
ftemp(); //open file as temporary file
fremove(const name[]);//delete file
fwrite(handle, array[]);//write array to file
fread(handle, array[], size = sizeof array, pack = false);//read from file
fputchar(handle, value, utf8 = true);//put char into file
fgetchar(handle, value, utf8 = true);//read char from file, move pointer
fblockwrite(handle, const buffer[], size = sizeof buffer);//write block
fblockread(handle, buffer[], size = sizeof buffer);//read block, move pointer
fseek(handle, position = 0, seek_whence: whence = seek_start);//move pointer
flength(handle);//size of file
fexist(const pattern[]);//check if file exists
fmatch(name[], const pattern[], index = 0, size = sizeof name);//search for file
这只是伪代码:P
Linux(以及许多BSD,我相信包括MacOSX)使用FUSE系统(http://fuse.sourceforge.net/)来提供这些类型的服务。你应该能够在"网上"上找到很多例子。
我相信在 Windows 上做同样事情的"接受"方法是将其编写为设备驱动程序可加载模块 ( .dll
) ...也许,快速的谷歌搜索指向 http://msdn.microsoft.com/en-us/windows/hardware/gg463062 作为起点。
相关文章:
- 文件系统:复制功能的速度秘诀是什么
- c++17文件系统::recursive_directory迭代器()在mac上没有给出这样的目录,但在windows上
- 如何传递多个 std::文件系统选项?
- 遍历顺序由 std::文件系统directory_iterator给出
- libstdc++ 文件系统中未初始化的用法?
- boost::文件系统::recursive_directory_iterator多线程安全
- C++17 文件系统::remove_all 带有通配符路径
- 实验性文件系统库不完整C++?
- 使用文件系统时仍然需要链接到带有 C++20 的 stdc++fs?
- 无法链接文件系统库C++
- 无法识别 Mac c++ 文件系统库
- 使用Boost文件系统C++将具有特定扩展名的文件的名称保存在特定文件夹中
- 获取 clang++:错误:在编译文件系统库的代码时
- Windows本身是否有虚拟或临时文件系统
- C++中的虚拟(平面)文件系统
- 如何创建文件路径可以像磁盘一样访问的虚拟文件系统
- 虚拟文件系统列表
- C++/C 虚拟/可嵌入文件系统 [交叉兼容(库)]
- 在虚拟文件系统中运行进程
- 创建一个网络虚拟硬盘/文件系统