microsoft / ProjFS-Managed-API

A managed-code API for the Windows Projected File System
Other
142 stars 34 forks source link

Pure virtual file system (without any kind of caching/hydrating) #54

Closed fiddyschmitt closed 3 years ago

fiddyschmitt commented 3 years ago

Is there a way to stop ProjFS from making a physical file when a virtual file is read?

In my backing store, I have a list of virtual files.

public class VirtualFile
{
    public string Filename;
    public Stream Stream;
}

If the contents of a virtual file are requested, I can just read from the Stream to get the requested bytes. The issue is that ProjFS creates a physical file with those contents, which I want to avoid. This is because the Streams I'm dealing with are much larger than the HDD's capacity.

So is there a way to not create physical files, and instead just respond with populated buffers like we can in Dokany?

cgallred commented 3 years ago

No, that isn't currently possible. ProjFS was originally designed to allow us to project an extremely large git repo onto developer workstations. We wanted the performance of the developer's code-build-test cycle to be comparable to what you'd get if the files were locally present, so ProjFS essentially uses the local file system as a cache of the backing store. That lets us amortize the retrieval delay across the time the file is used. Given that scenario focus, we didn't include a streaming mode in it.

fiddyschmitt commented 3 years ago

Understand; thanks for the explanation Christian

fiddyschmitt commented 2 years ago

Hi Christian, Happy New Year!

Is streaming mode on the cards? It would let me use ProjFS for some interesting use cases.

Thanks, Fidel

cbenhagen commented 1 year ago

@cgallred do you have any news on this? We also have a use case where caching locally needs to be disabled.