Hi all,
Ruby 1.8.1
Solaris 9
mmap 0.2.4
I was just futzing with mmap and I tried this:
require "mmap"
# test.txt contains:
# "The quick brown fox jumped over the lazy dog's back"
# three times, one per line.
file = "test.txt"
m = Mmap.new(file,"rw")
pid = fork
fork{
m.gsub!(/fox/,"badger")
}
Process.wait
m.gsub!(/badger/,"sloth")
m.unmap
This mostly works as expected, except that the 3rd line of the text
file ends up with the last 7 characters chopped off. What did I do
wrong?
While I'm at it, does anyone have a "really cool tricks with mmap"
paper laying around somewhere?
Regards,
Dan