Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^7: Memory mapped file questions

by Corion (Patriarch)
on Oct 10, 2020 at 18:47 UTC ( [id://11122671]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Memory mapped file questions
in thread Memory mapped file questions

C++ or C# programs are also not able to access this memory mapped file. If it does not have a name, you need to pass the file handle to the process that is supposed to read from the file by inheriting the filehandle in a child process. Perl can easily inherit file handles, but then you need to launch the process for reading the data from your main program.

You will need to learn more about the usage of memory mapped files and IPC in general. Your approach makes things far harder than necessary, or you need to state much more about why you need to use a memory mapped file.

Replies are listed 'Best First'.
Re^8: Memory mapped file questions
by faustf (Novice) on Oct 11, 2020 at 07:46 UTC
    but the name of file exist and is Test , i run a MSDN example in C# and in C++ , in msdn i have first program create a memory mapped file , second program (i dont run a second program by main program), read perfect a string memory mapped file , therefore i simply want do it with perl. Why i do this ? simply i want understand how work a file mapped, and look how is complicated or not , in many program language , but if you confirm perl don't do it because for perl is necessary have a real file in HDD , no problem

      If that works, then you can likely do the same in Perl. But as I don't know your C++ code to access that memory mapped file, you will have to find out yourself what API calls C# uses and how to access these from Perl.

      CPAN has some modules for memory mapping files, see Mmap, maybe you find something there. Or alternatively, maybe you can open the file just as a file, see open. In any case, you will have to find out what works for you, because I'm not going to learn what Windows API the C# code uses.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122671]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found