[#5219] Segmentation fault in timeout.rb — Michel Pastor <K@...>

Hi,

18 messages 2005/06/16
[#5220] Re: Segmentation fault in timeout.rb — Eric Hodel <drbrain@...7.net> 2005/06/16

[#5221] Re: Segmentation fault in timeout.rb — Michel Pastor <K@...> 2005/06/16

On Fri, 17 Jun 2005 05:03:18 +0900

[#5223] Re: Segmentation fault in timeout.rb — nobu.nokada@... 2005/06/17

Hi,

[#5296] Subversion — Shugo Maeda <shugo@...>

Hi,

64 messages 2005/06/30
[#5297] Re: Subversion — Curt Hibbs <curt@...> 2005/06/30

Shugo Maeda wrote:

[#5298] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Curt Hibbs wrote:

[#5301] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5304] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Austin Ziegler wrote:

[#5305] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5307] Re: Subversion — mathew <meta@...> 2005/06/30

Austin Ziegler wrote:

[#5308] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, mathew <meta@pobox.com> wrote:

[#5311] Re: Subversion — mathew <meta@...> 2005/07/01

Austin Ziegler wrote:

[#5323] Re: Subversion — Austin Ziegler <halostatue@...> 2005/07/01

On 7/1/05, mathew <meta@pobox.com> wrote:

[#5325] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/07/01

Austin Ziegler wrote:

IO#read

From: "Kirill A. Shutemov" <k.shutemov@...>
Date: 2005-06-10 07:07:46 UTC
List: ruby-core #5187
irb(main):001:0> file = File.open( 'test.1', 'w+')
=> #<File:test.1>
irb(main):002:0> file.write( '1234')
=> 4
irb(main):003:0> file.read(1)
=> nil
irb(main):004:0> file.read
=> ""
irb(main):005:0> file.read(1)
=> 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]])    => 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?

-- 
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

In This Thread

Prev Next