From: Joel VanderWerf Date: 2008-09-03T04:05:50+09:00 Subject: Re: IO#write_nonblock(string, offset) useful? Roger Pack wrote: > Was asked to repost this under a separate thread, so here it is! > > Currently we have > IO#write_nonblock(string) [writes as much of the string as currently > possible] > > What I was thinking would be useful would be > IO#write_nonblock(string, offset) [starts the write at offset bytes into > the string]. > > Would anybody else find this useful? > Thanks! With COW strings, is this really needed? s = (0..9).to_a.to_s * 1000000 sa = (1..10000).map {|i| s[i..-1]} puts `cat /proc/#{$$}/status`[/VmRSS:\s*(.*)/,1] # 13292 kB Is there a reason other than saving memory and avoiding a #slice call? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407