From: "Kirill A. Shutemov" Date: 2005-06-10T16:07:46+09:00 Subject: IO#read --EuxKj2iCbKjpUGkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable irb(main):001:0> file =3D File.open( 'test.1', 'w+') =3D> # irb(main):002:0> file.write( '1234') =3D> 4 irb(main):003:0> file.read(1) =3D> nil irb(main):004:0> file.read =3D> "" irb(main):005:0> file.read(1) =3D> nil irb(main):006:0> Why does IO#read at the end of file without argument return "", but with a interer return nil? ---------------------------------------------------------------- IO#read ios.read([integer [, buffer]]) =3D> string, buffer, or nil ------------------------------------------------------------------------ Reads at most _integer_ bytes from the I/O stream, or to the end of file if _integer_ is omitted or is +nil+. If the optional _buffer_ argument is present, it must reference a String, which will receive the data. Returns +nil+ if called at end of file. Is it bug? --=20 Kirill A. Shutemov Belarus, Minsk E-mail: k.shutemov (AT) sam-solutions.net JID: kas (AT) altlinux.org ICQ: 152302675 If Beethoven's Seventh Symphony is not by some means abridged, it will soon fall into disuse. -- Philip Hale, Boston music critic, 1837 --EuxKj2iCbKjpUGkD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCqT1obWYnhzC5v6oRAj+CAJ9tN1MnY6y+nexk9Mgxe5S7AkwN6ACfZaM3 pGm10aub9cul2pils1IUowk= =joe6 -----END PGP SIGNATURE----- --EuxKj2iCbKjpUGkD--