sehang / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

feature request: ability to get notified when iso has completely mounted #180

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Dokan 0.5.3

When using DokanNet, the call to DokanNet.DokanMain will block the current 
thread.

That is okay because I can create a new thread that calls DokanNet.DokanMain to 
mount the iso.

However, the issue is that I cannot determine when the iso has completely 
finished mounting.

For example, see CueMounter (http://cuemounter.codeplex.com)

I would have expected to be able to read files in the iso immediately after 
calling DokanMounter.Mount(), but that is not the case in the scenario where I 
have a large iso file that may take a few seconds to finish mounting.

The current work-around is to loop\sleep\wait until the drive can be accessed, 
but this is not the best way to solve this problem.

Thank you.

Original issue reported on code.google.com by rami.abughazaleh@gmail.com on 28 Aug 2010 at 2:12

GoogleCodeExporter commented 8 years ago
I solved a similar scenario by performing the following (in .net 4)
do
{
   string[] drives = Environment.GetLogicalDrives();
   if (Array.Exists(drives, dr => dr.Remove(1) == configDetails.DriveLetter))
      break;
   Log.Info("Waiting for Dokan to create the drive letter before reappling the shares");
   Thread.Sleep(100);
} while (ManagementLayer.Instance.State == LiquesceSvcState.Running);
See the end of LiquesceOps.cs in http://liquesce.codeplex.com/

Original comment by smurf...@gmail.com on 29 Aug 2010 at 5:08

GoogleCodeExporter commented 8 years ago
Thanks, smurf.iv.

The work-around I use is this:

string path = options.DriveLetter + @":\";
while (!Directory.Exists(path))
{
  Thread.Sleep(1000);
}

;)

Original comment by rami.abughazaleh@gmail.com on 31 Aug 2010 at 6:38

GoogleCodeExporter commented 8 years ago
There are issues with that method
see 
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/2d7c9648-5b12-42a4
-a4a8-5d52157de0b6
Also the Dokan - Drive letter may will be turning into a unc / mount path 
(WhenEver the next version sees the light of day !)
So I think we should both try and find another way !

Original comment by smurf...@gmail.com on 6 Sep 2010 at 7:19