From: Eric Hodel Date: 2003-04-10T09:21:11-07:00 Subject: Re: Need IO Optimization help --GPJrCs/72TxItFYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jim Freeze (jim@freeze.org) wrote: > Could some expert look at the code below and tell me > what could be done to speed up the code below. Possibly > using #read or #sysread. Or, if someone has some ruby C > code, that would be cool. >=20 >=20 > #------ rw.rb > file =3D ARGV.shift >=20 > File.open(file + ".out", "w") { |of| > File.open(file).each {|line| > # do processing here > of.print line > } > } > #------- require 'ftools' file =3D ARGV.shift File.syscopy(file, "#{file}.out") if you want raw IO, you can use the begin ... end chunk from ftools. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --GPJrCs/72TxItFYR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD4DBQE+lZn3MypVHHlsnwQRApZxAJiuv8QaUEEdNsWddmuF68QOk0jkAKDd8bqj gL+p14etI3gsbRf6kuHAUg== =MIsX -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR--