On Friday, 11 April 2003 at 1:27:25 +0900, nobu.nokada / softhome.net wrote: > Hi, > > At Fri, 11 Apr 2003 01:03:08 +0900, > Jim Freeze wrote: > > The Ruby code is below. I know there have been multiple > > posts on ruby-talk about this with discussions about > > sysread and read, but not being an IO expert, I have > > only been able to follow these at a high level. > > You can use File.cp in ftools.rb or FileUtils.cp in > fileutils.rb. I see the syswrite src.sysread(bsize) in copy_stream, but I need the data line by line to process. It's just that for our tests we are not doing any processing. So, while a direct copy may be fast, it is not exactly what I want. def copy_stream( src, dest ) bsize = fu_stream_blksize(src, dest) begin while true dest.syswrite src.sysread(bsize) end rescue EOFError end end Is there a system call that reads line by line? -- Jim Freeze ---------- I can't understand it. I can't even understand the people who can understand it. -- Queen Juliana of the Netherlands.