• Perl Win32 MemMap Amine Moulay Ramdane

    From Amine Moulay Ramdane@21:1/5 to All on Sat Mar 26 02:56:57 2022
    XPost: comp.programming.threads

    #########################################################
    #
    # Win32::MemMap - Perl Win32 MemMap module - version 2.03
    #
    #
    # Author : Amine Moulay Ramdane <aminer@generation.net>
    # Company: Cyber-NT Communications
    # Phone: (514)485-6659
    # Email: aminer@generation.net
    # Date: February 7,1999
    #
    # Copyright o?= 1998 Amine Moulay Ramdane.All rights reserved
    #
    #########################################################



    This module can be used with:

    The Perl for Win32 port by ActiveState: Build 300,5.00502 or higher
    The core Perl 5.004 and 5.005 or higher (built on the Win32 platform, of course)


    How to install MemMap?

    For Perl AS 5.0050x and GS 5.0050x:

    If your Perl is installed under C:\Perl copy the MemMap.pm file to C:\Perl\site\lib\Win32 and copy memmap.dll to \winnt\system32
    (for Winnt) or \windows\system (for Win95)


    For Perl AS 5.003_0x:

    Copy the MemMap.pm file to C:\Perl\lib\Win32 and copy my memmap.dll
    to \winnt\system32 (for Winnt) or \windows\system (for Win95)


    Have fun!


    Disclaimer
    ----------
    WARNING! ALTHOUGH I HAVE BEEN USING THIS MODULE FOR A LONG TIME WITHOUT
    ANY KNOWN PROBLEM,THIS MODULE IS PROVIDED AS IS WITH NO GUARANTEES OF ANY
    KIND! - YOU ARE THE ONLY PERSON RESPONSIBLE FOR ANY DAMAGE THIS CODE MAY CAUSE .

    Enjoy!

    Sincerely,
    Amine Moulay Ramdane
    aminer@generation.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Amine Moulay Ramdane@21:1/5 to All on Sat Mar 26 02:58:27 2022
    XPost: comp.programming.threads

    use Win32::MemMap qw(ENABLE_MAPPING DISABLE_MAPPING);


    print "\n Using Win32::MemMap version ", $Win32::MemMap::VERSION, "\n";
    print " By Amine Moulay Ramdane <aminer\@generation.net>\n";
    print " Please hit any key to start the Demo...";
    <STDIN>;
    my $obj=new Win32::MemMap; $FileMap=$obj->OpenFile("morocco.gif","//MemMap/test",ENABLE_MAPPING);
    print "\n";
    $obj->LastError;
    $FileMap->Read(\$str,0,$FileMap->{Size});
    my $mem=$obj->OpenMem("//MemMap/PerlWin32",$FileMap->{Size}); $mem->Write(\$str,0);
    undef $str;
    $mem->Read(\$str,0,$FileMap->{Size});
    print "\nThis small script will map a file [morocco.gif] to a shared memory,\n";
    print "a second process [prog2.pl] will get it directly from the sharedmem and\n";
    print "copy the data to a new file named [new.gif], please run now the second script\n";
    print "[prog2.pl], and when all is done hit enter to close the sharedmem: "; <stdin>;
    print "\nThe actual shared memory data size is: ".$mem->GetDataSize."\n";
    print "The shared memory size is: ".$mem->GetSize."\n";
    print "The shared memory name is: ".$mem->GetName."\n";
    $obj->LastError;
    $mem->Close;
    $FileMap->Close;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)