Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Memory mapped file questions

by faustf (Novice)
on Oct 10, 2020 at 09:21 UTC ( #11122655=note: print w/replies, xml ) Need Help??


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

Msdn docet MemoryMappedFile.CreateOrOpen Metod: Creates a new empty memory-mapped file or opens an existing one IF one with the same name exists. (i assure not exist a file in my HDD with name Test ) if i wanted to open a file i would used this MemoryMappedFile.CreateFromFile Create a memory-mapped file from a disk file.

Replies are listed 'Best First'.
Re^5: Memory mapped file questions
by Corion (Pope) on Oct 10, 2020 at 09:29 UTC

    If you don't create the file on disk, how do you expect Perl to read from that file?

    My suggestion to you is to look at other approaches of passing data to another program than using an unnamed memory mapped file.

      I thought it could do it like c++ or c# does, therefore you confim perl is not able to do that ?

        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2021-09-27 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?