[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
File::Stat#blksize etc. should return nil instead of 0
From:
Florian Frank <flori@...>
Date:
2002-08-07 10:08:46 UTC
List:
ruby-core #305
On Sun, 2002-08-04 at 01:45, Yukihiro Matsumoto wrote:
> I'd like to hear from others,
> especially those who working on the platforms without these members in
> struct stat.
Ok, nobody seems to use those platforms (MS Windows, I guess) anyway. ;)
But I can try to explain more clearly where I see a problem. If somebody
writes some code like this
File.open(File.join("anyfile") do |f|
until f.eof?
s = f.read(f.stat.blksize)
# do something
end
end
it will work ok, if the platform supports blksize. If it doesn't this
will be an infinite loop because many reads of 0 bytes won't reach EOF.
With nil it would be ok by accident.
If f.read(8 * f.stat.blksize) is used, a type error will occur. But such
an error is probably better than a semantic error which causes the
program to get stuck in a loop.
--
Give me a man or a woman who has read a thousand books and you give me
an
interesting companion. Give me a man or a woman who has read perhaps
three and
you give me a dangerous enemy indeed.
-- Anne Rice, "The witching hour"