Search code examples
.netwcfservicefilesystems

UNC Virtual Folder


I would like to expose some service functionality as a virtual file share to allow conventional applications to use the virtual folder as a real one.

For example, a file path consisting of

\\\\Server\VirtualShare\File.ext

means that VirtualShare doesn't really exist and only available as long as my service is running. A file access with the virtual share must implicitly use my service.

My question is, whether some API (of samples) exist to expose own virtual file shares. What's about WCF?


Solution

  • You would need to write a file system driver to do this. It is fascinating but horrendously difficult and can only be done in C (not even C++). If you are interested check out the Windows Driver Kit.

    EDIT: You can check out some user mode file system stuff like Dokan which is interesting but I wouldn't use it in production or Callback File System a commercial one that I have heard little about so I can't recommend it one way or the other.