home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 55,644 of 57,431   
   Amine Moulay Ramdane to All   
   Perl Win32 MemMap   
   26 Mar 22 02:58:27   
   
   XPost: comp.programming.threads   
   From: aminer68@gmail.com   
      
   use Win32::MemMap qw(ENABLE_MAPPING DISABLE_MAPPING);   
      
      
   print "\n Using Win32::MemMap version ", $Win32::MemMap::VERSION, "\n";   
    print " By Amine Moulay Ramdane \n";   
    print " Please hit any key to start the Demo...";   
    ;   
   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: ";   
   ;   
   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: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca