1

I have a weird requirement.

I have to map a folder as a Virtual Drive in My Computer with a custom drive icon on it. Also the mapped virtual drive should be of predefined limited size (say XX GB).

I know and mapped a folder as a virtual drive in my computer but I am not able to limit the size of the drive as it is a kind of Shortcut to the folder and also we can not limit a folder to a specific size. While searching on the topic, I came across IsolatedStorage which is not what I needed. I also found DefineDosDevice(int flags, string devname, string path) in kernel32.dll through which I am able to map a folder to my computer but not able to achieve other functionality.

Is it possible to achieve what I am looking for?

Alex K.
  • 171,639
  • 30
  • 264
  • 288
Vinod Maurya
  • 4,167
  • 11
  • 50
  • 81

1 Answers1

0

I'm sure it is possible. Do you think you could create an application that registers these folders and then add it to a file system watcher. Intercept any writes and cancel them if the file size + the current folder size is greater than the max.

Maybe break the problem down into small chunks.

I'm sure there is a better way, but a service application that integrates itself with the OS would be a very good option.

Hope that helps. Please dont minus rep, I just like problems like this. Its a very good question!

Base33
  • 3,167
  • 2
  • 27
  • 31