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

Hi isync, thanks for your report! (I'm tofjw. Sorry I don't have an account on this site.)

1. Many warnings.

Warnings about SyncExec are reported because first argment of SyncExec is decalared as:

typedef int (Func_t)(SV* self, void* pParam);

but passed function (ex. DP_WriteFile) is declared like below.

static int DP_WriteFile(void* self, void* pParam)

(conflict of SV* and void*)

Yes, it's a bug, but I think it's harmless.

2. Not resolved symbols (_gmtime64_s and _localtime64_s)

They are thread safe 64bit variant of gmtime (and localtime) in MSVC runtime. If they are not in your C runtime, you can re-write using gmtime and localtime. Because in this version of Win32-Dokan, execution of callbacks are serialized using Win32 event object.

First, replace functions in Dokan.xs like following and try build.

static void set_file_time(LPFILETIME pFileTime, time_t t) { *pFileTime = 0; } static time_t get_file_time(const FILETIME* pFileTime) { return 0; }

Timestamp will be NOT correct, but you can confirm script works or not.

Replies are listed 'Best First'.
Re^3: Perl to mount a virtual filesystem on Windows?
by isync (Hermit) on Apr 02, 2009 at 17:28 UTC
    Thank you for getting back! I will try another compile-run as soon as possible.

    Update: I actually managed to get a version together that threw only warnings on dmake. A subsequent dmake -i got me to a runnable version of Win32::Dokan.
    Anyway, running examples/mirror.pl resulted in an error: "&Win32::Dokan::constant not defined at mirror.pl line 17" with line 17 being
    14: my $fs = Mirror->new("D:/"); 15: my $mounter = Win32::Dokan::Mounter->new({debug_mode => 1, 16: use_std_err => 1}); 17: $mounter->mount('W', $fs);


    Testing other combinations: this SVN version lacks a META.yml (the sourceforge version contains it) and using it with the modifications in Dokan.xs gave among warnings an error: "In function `set_file_time': Dokan.xs:296: error: incompatible types in assignment".

    I hope this helps and you feel motivated for another release/patch on SVN: trunk that works more seamlessly with newer dokan.h.

      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.

        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.