in reply to Re^3: Perl to mount a virtual filesystem on Windows?
in thread Perl to mount a virtual filesystem on Windows?

I wrote small patch for starwberry perl. Try newer svn trunk with dokan.h(r7), please.

I got good result with strawberry perl 5.8.9.

  • Comment on Re^4: Perl to mount a virtual filesystem on Windows?

Replies are listed 'Best First'.
Re^5: Perl to mount a virtual filesystem on Windows?
by isync (Hermit) on Apr 09, 2009 at 21:13 UTC
    Thank you for the patch. I really appreciate your effort!

    My experience this time was much smoother, but still not 100%. I fetched the newest revision from SVN and combined it with revision 7 of dokan.h. dmake ran through without error and resulted in a Dokan.dll in the blib\arch\auto\Win32\Dokan directory.

    But, as it seems, the dmake install routined did something wrong, I had to manually copy the .dll into my strawberry directory, so that Dokan.pm's "package Win32::Dokan::_DLL;" could find it in the ENV. (btw, I opted for the sub dir C:\strawberry\c\bin).

    In test-fs.t, ~line 33, there's is a typo in the path, see:
    for my $p (split(/;/, $ENV{PATH}), 'C:\\Program Files\\Dokan\\DokanLIbrary', 'D:\\Program Files\\Dokan\\DokanLIbrary',) {
    the capital "I". And the sub assumes Dokan to reside in the default location (which wasn't the case on my system, I installed it in Program Files\\DokanLibrary...

    Then:
    Another note: I think I was under a misconception about how Dokan works. I wasn't aware that I need to have Dokan installed! I thought, having the Dokan.dll alone would suffice. But a call for dokanctl.exe during the tests told me that I need to have it.
      Confusion in DLL loading

      As you understand now, Dokan library must be installed first. It provides

      • dokan.dll (Dokan user mode library)
      • dokan.sys (Dokan File System Driver)
      • mounter.exe (Dokan mounter service)

      and some files.

      See dokan-readme for detailes.

      Win32::Dokan's Dokan.DLL is just an interface between dokan.dll (Dokan Library's one) and Perl.

      Win32::Dokan's Dokan.DLL will be found by DynaLoader, so you does not need to copy it manually. It will be copied to default place (C:\strawberry\perl\site\lib\...) by executing "dmake install". I think this is an usual way for XS module.

      Win32::Dokan::_DLL searches Dokan Library's dokan.dll, not a Win32::Dokan's. If Dokan library is installed correctly, It will be found in System Folder.

      Test is improved
      • Waiting method for test-fs.pl is changed. Hard coded waiting time is removed.
      • To unmount test filessystem, unmount.pl is added Dokanctl.exe wil not be called now.

      (But this is little danger. If Win32::Dokan does not works correctly, test filesystem will be not unmounted. Any idea?)

      Thanks to your advice.