From: ts Date: 2000-12-21T15:08:51+09:00 Subject: [ruby-talk:7843] Re: String as IO and/or File object? >>>>> "B" == Brian F Feldman 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