Firstly I don't completely have a clue if the so-called Platform.VirtualFileSystem
can do this. What I want for a virtual file system is somehow create a virtual file from a Stream
(that I've already had). The system (OS) will be able to access that virtual file as if it was a real file (transparently).
After browsing the classes hierarchy of the Platform.VirtualFileSystem
, I could not completely find anything related to what I want. It looks just like that I can link an actual system file to the virtual file but here I don't even have the actual system file, what I have is just a Stream
.
Does anyone have a simple example to illustrate this? As I said before, I did not even know if that library is what can help me. So if you have another alternative ones that could solve my problem, please suggest.
I'll say that you are looking at the wrong tool. The
Platform.VirtualFileSystem
is an abstraction of various fs for the program that links toPlatform.VirtualFileSystem,
. It doesn't seem to export this abstraction to other programs.What you need is a full file system. But note that a full file system is a full disk. You don't create a file, you create a virtual disk with a file. See for example dokan.
One of the things it can do is:
Note that using Dokan seems to be quite complex. Normal persons don't go around writing file systems. For sure it is at least a little over my level. You can probably begin with the example read-only file system for the Registry and trim from there.