Let’s say foo.pid contains “12345” (no newline).
irb(main):001:0> VERSION
=> “1.8.1”
irb(main):002:0> IO.readlines(“foo.pid”)
=>
This a bug?
It should be. Since it works completely on my machine, it must be a
Solaris specific bug. Wish I had a Solaris box. Let me see anyway.
It should be. Since it works completely on my machine, it must be a
Solaris specific bug. Wish I had a Solaris box. Let me see anyway.
If I'm right the bug is in the part
#ifndef READ_DATA_PENDING_PTR
if ((*bp++ = c) == delim || bp == bpe) {
cnt = bp - buf;
if (cnt > 0) {
if (!NIL_P(str))
rb_str_cat(str, buf, cnt);
else
*strp = str = rb_str_new(buf, cnt);
}
bp = buf;
} #endif
it use a 64 bit ruby/Solaris and in its case READ_DATA_PENDING_PTR is not
defined.
Now `c' never equal `delim' (because it don't have a newline at the end),
and bp != bpe (it read only few characters) this mean that *strp is never
created if I'm right