in reply to Re: mmap in Perl?
in thread mmap in Perl?

Well see that's it..
My kittens die.. heh

But indeed, I made a bit of a odd end that that error description. Well I wrote to scripts.The first one, and one that reads the file with mmap.

The Reader works, but that piece of code should write to the mmapped file. But it doesn't even do that...

The Writer doesn't do a thing at all.

I hope I supplied enough information now.
Thanks.

Replies are listed 'Best First'.
Re^3: mmap in Perl?
by ww (Archbishop) on Oct 19, 2009 at 12:36 UTC

    Not yet.

    • Do you get an error message? If so, quote it exactly.
    • Is the mmapped file updated in any manner? If so, state precisely what happens
    • Does the script appear to execute and terminate? That may be part of the "enough information" we need to be helpful

      Ah so, Well lets just put down everything.

      [root@perlbox sandbox]# ls file1.pl file2.pl memory [root@perlbox sandbox]# cat memory XXXXXXXXXXXXXxxxxXxXXXXXXX [root@perlbox sandbox]# cat file1.pl use File::Map qw/:map lock_map sync/; use warnings; use strict; my $mmap = undef; my $file = "memory"; map_file $mmap, $file, '+<'; if (!defined($mmap)) { print "ERROR!!\n"; } for(my $i=0;$i<10000;++$i) { $mmap = $i; sync($mmap,1); } unmap ($mmap); [root@perlbox sandbox]# perl file1.pl [root@perlbox sandbox]# cat memory XXXXXXXXXXXXXxxxxXxXXXXXXX [root@perlbox sandbox]#

      So as you see it doesn't write to the memory file, while I would have guessed it would have write down some numbers, Since of..

      use File::Map qw/:map lock_map sync/; use warnings; use strict; my $mmap = undef; my $file = "memory"; map_file $mmap, $file, '+<'; if (!defined($mmap)) { print "ERROR!!\n"; } for(my $i=0;$i<10000;++$i) { <b>$mmap = $i;</b> sync($mmap,1); + } unmap ($mmap);

      the Bold code.
      Already thanks a lot. Is this the information required?