>>>>> "B" == Brian F Feldman <green / FreeBSD.org> writes:

B> File#mmap(len = self.stat.size, prot = "r", flags = MAP_SHARED, offset = 0)

 This is easy to do this :

pigeon% cat b.rb
#!/usr/bin/ruby
require "mmap"
a = String.mmap("b.rb", "rw")
a[12] = "X"
a.scan(/.*\n/) do |line|
   puts line
end
pigeon% 

pigeon% b.rb
#!/usr/bin/rXby
require "mmap"
a = String.mmap("b.rb", "rw")
a[12] = "X"
a.scan(/.*\n/) do |line|
   puts line
end
pigeon%
 
pigeon% cat b.rb
#!/usr/bin/rXby
require "mmap"
a = String.mmap("b.rb", "rw")
a[12] = "X"
a.scan(/.*\n/) do |line|
   puts line
end
pigeon% 

 see rXby :-)

 The big problem I think is with methods which can change RSTRING(str)->len

 Now try with File#mmap and you'll see the result :-)


Guy Decoux