Virtual drives in .NET?
Asked Answered
M

4

10

Is there any easy library for .NET to mount virtual drives?
I need to mount an archive in a virtual drive and, most likely, use a virtual file system.
The archive format does not support folders so I'd need to supply the files and folders manually from the archive. Attributes aren't supported as well but I use metadata files to store them.
The more control over the drive and FS I have, the better.

Merca answered 19/12, 2010 at 11:45 Comment(5)
What do you mean by " dokan does not work"? It includes working samples.Heffner
Nothing worked on my computers, god damn it!Merca
@Vercas: perhaps your OS is older than Windows XP?Heffner
@Vercas: Perhaps you can tell us about the problems you're experiencing with Dokan, and someone can help you. It sounds like that library is your best bet, especially if you want something free.Ensue
Unable to create the drive. Something about the drive letter. Edit: One time it did create a drive, but all I could do with it is mount an ISO on it with PowerISO.Merca
B
0

You can use the Dokan library to create a virtual drive. Take a look at Issue 43: Wont install on Windows 7

Bumf answered 22/12, 2010 at 21:18 Comment(3)
Issue 43 does not happen to me. It installs fine and all that. The installer version creates a DVD partition that can be used by PowerISO. The code version, on the other hand, first fails to find a free partition and then it says it can't create the partition (after I manually specify a free one).Merca
work for me, but you can try to run under Windows 7 XP Mode.microsoft.com/Windows/virtual-pc/download.aspxBumf
@MastAvalons +1 great sdk for virtualizationBohn
G
8

Windows 10 provides cloud filter API and projected file system API. Both run in user mode, do not require signing and driver installation. The cloud filter API is part of Windows for a couple of years already.

Example in .NET on GitHub.

Granddad answered 16/4, 2021 at 9:47 Comment(1)
Now this is interesting.Merca
B
0

If you need to do this in code, you can use our Callback File System -- this product was designed for tasks like yours in mind. It lets you define the structure of the file system in your code and perform reading and writing in your code as well. So you can read from and write to any archive format you need.

Blink answered 19/12, 2010 at 12:32 Comment(1)
Doesn't "evaluation" mean that I am allowed to evaluate the product and see if it suits my needs? If it does, do I have to buy it? If I do, then this is not a solution. I am not going to make any money with my program, I don't have any money to spend and I am only 15 years old.Merca
L
0

PowerShell (PSH) offers the ability to create "Providers" which allow various resources to be treated like a file system (including the file system, registry, active directory) at various levels of capability down to simple name-value lists (e.g. dir env: will list all environment variables as content of the env: drive).

PowerShell can also be embedded in in a .NET application: roughly speaking create a Runspace and then execute commands and scripts in it, including loading a PSH Module which includes a custom provider. Properties on the Runspace instance allow access to the drives and their providers.

Lochia answered 19/12, 2010 at 13:28 Comment(3)
I must really look into this!Merca
The new mounted directories are only available inside powershell I guess.Leanaleanard
@CodeInChaos: True, but that's going to be true of anything that doesn't involve drivers (to expose virtual drives to Win32 APIs they need to be in the kernel).Lochia
B
0

You can use the Dokan library to create a virtual drive. Take a look at Issue 43: Wont install on Windows 7

Bumf answered 22/12, 2010 at 21:18 Comment(3)
Issue 43 does not happen to me. It installs fine and all that. The installer version creates a DVD partition that can be used by PowerISO. The code version, on the other hand, first fails to find a free partition and then it says it can't create the partition (after I manually specify a free one).Merca
work for me, but you can try to run under Windows 7 XP Mode.microsoft.com/Windows/virtual-pc/download.aspxBumf
@MastAvalons +1 great sdk for virtualizationBohn

© 2022 - 2024 — McMap. All rights reserved.