[#22109] diffコマンドのオプションは? — Shibukawa Yoshiki <yoshiki@...>
渋川です。
[#22120] invalid parameter to fcntl in drb.rb — siena@... (Siena. / SHINAGAWA, Norihide)
Siena. です。
西山和広です。
Siena. です。
こんにちは、なかむら(う)です。
[#22144] core dump with ObjectSpace.each_object. — Tanaka Akira <akr@...17n.org>
次のように core を吐くことがあります。
まつもと ゆきひろです
なかだです。
[#22167] 1.8.1 preview3 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
In message <1070645035.747201.27874.nullmailer@picachu.netlab.jp>
まつもと ゆきひろです
In message <1070904807.535101.6285.nullmailer@picachu.netlab.jp>
まつもと ゆきひろです
[#22173] iconv map_charset on Solaris — Tanaka Akira <akr@...17n.org>
Solaris で、config.charset を用意しておいても
[#22190] override private methods — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
[#22195] IO::for_io and TCPServer#bind — GOTOU Yuuzou <gotoyuzo@...>
test_drb が IPv4 射影アドレスが有効な環境でないと動かないこ
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
まつもと ゆきひろです
なかだです。
なかだです。
なかだです。
まつもと ゆきひろです
[#22205] yet another inconsistency about EOF between StringIO and IO — Tanaka Akira <akr@...17n.org>
StringIO の
なかだです。
In article <200312100725.hBA7P8Ac011112@sharui.nakada.kanuma.tochigi.jp>,
なかだです。
In article <200312100917.hBA9HuAc013516@sharui.nakada.kanuma.tochigi.jp>,
さかいといいます。
In article <20031211.214041.71090239.sakai@tom.sfc.keio.ac.jp>,
In article <87k751dzyf.fsf@serein.a02.aist.go.jp>,
まつもと ゆきひろです
In article <1072167374.096702.13473.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1072187210.052832.16566.nullmailer@picachu.netlab.jp>,
[#22235] block to method by proc — nobu.nakada@...
なかだです。
まつもと ゆきひろです
[#22238] errors in test/fileutils — siena@... (Siena. / SHINAGAWA, Norihide)
Siena. です。
[#22251] lib/fileutils.rb — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#22289] mswin32 optimize — Tietew <tietew-ml-ruby-dev@...>
Tietew です。
[#22307] "rdoc -r" causes SEGV — akira yamada <akira@...>
まつもと ゆきひろです
[#22330] core dump with ungetc — Tanaka Akira <akr@...17n.org>
次のように ungetc を使うと core を吐く場合があります。
なかだです。
In article <200312230824.hBN8O5kM005374@sharui.nakada.kanuma.tochigi.jp>,
なかだです。
[#22344] pack('N') broken on 64bit platforms — Minero Aoki <aamine@...>
青木です。
[#22356] (OSX) TCPServer.open(hostname, 0) — Masatoshi SEKI <m_seki@...>
咳といいます。
まつもと ゆきひろです
まつもと ゆきひろです
[#22366] `to_s': method `to_s' overridden (TypeError) — Tanaka Akira <akr@...17n.org>
そういえば、次の `to_s': method `to_s' overridden (TypeError) というの
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
[#22375] win32 thread — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#22385] Tk.callback_break causes seg-fault or hang-up — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
まつもと ゆきひろです
永井@知能.九工大です.
まつもと ゆきひろです
まつもと ゆきひろです
永井@知能.九工大です.
まつもと ゆきひろです
まつもと ゆきひろです
[#22389] patches for i386-os2-emx — siena@... (Siena. / SHINAGAWA, Norihide)
Siena. です。
[#22403] dlfcn.h on NetBSD — Minero Aoki <aamine@...>
青木です。
[#22418] ruby-1.8.1 build failed on HP-UX 11.11 — MIYAMUKO Katsuyuki <k-miyamuko@...>
みやむこです。
まつもと ゆきひろです
まつもと ゆきひろです
みやむこです。
みやむこです。
なかだです。
みやむこです。
なかだです。
みやむこです。
なかだです。
みやむこです。
なかだです。
みやむこです。
[#22433] ARGF.read(nil) — Tanaka Akira <akr@...17n.org>
というわけで気がついたのですが、
まつもと ゆきひろです
In article <1072453715.631656.23109.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
[#22435] Re: [ruby-cvs] ruby: * io.c (rb_f_backquote): need not to check nil result. — Tanaka Akira <akr@...17n.org>
In article <20031226153432.0AF6A45A809@helium.ruby-lang.org>,
[#22469] ARGF.each {|x| ARGF.eof? } and number of Ctrl-Ds. — Tanaka Akira <akr@...17n.org>
次のプログラムは、a^D^D と入力すると終了します。この場合終了には ^D は
[ruby-dev:22225] Re: yet another inconsistency about EOF between StringIO and IO
In article <8765gp9fob.fsf@serein.a02.aist.go.jp>,
Tanaka Akira <akr@m17n.org> writes:
> あとこれも
結局、網羅的に StringIO と IO を比較してしまい、次のを見つけました。
% echo -n > zz
% ruby -e 'f = open("zz")
p f.read
open("zz", "w") {|g| g << "a" }
p f.read
'
""
nil
% ruby -rstringio -e 'buf = ""
f = StringIO.new(buf)
p f.read
buf << "a"
p f.read
'
""
"a"
まぁ、横から内容をいじるのはさすがに反則な気もします。
あと、思ったのですが、EOF flag に依存した挙動を仕様とするのは IOモドキ
を作る時にすごく間違いやすいため、結局、仕様を EOF flag に依存しないよ
うに変えるほうが適切なのかもしれません。つまり、read(nil) を常に
String を返すようにするわけですが。
比較スクリプト:
require 'stringio'
require 'tempfile'
def make_io(content, pos, eof)
io = Tempfile.new("xxx")
io.seek pos
io.read if eof
open(io.path, "w") {|f| f << content }
if content != File.read(io.path)
p [:io_content, content, pos, eof, io.string]
end
if pos != io.pos
p [:io_pos, content, pos, eof, io.pos]
end
if eof != !io.read(0)
p [:io_eof, content, pos, eof, io.read(0)]
end
io
end
def make_stringio(content, pos, eof)
buf = ""
io = StringIO.new(buf)
io.seek pos
io.read if eof
buf << content
if content != io.string
p [:stringio_content, content, pos, eof, io.string]
end
if pos != io.pos
p [:stringio_pos, content, pos, eof, io.pos]
end
if eof != !io.read(0)
p [:stringio_eof, content, pos, eof, io.read(0)]
end
io
end
def make_stringio(content, pos, eof)
if pos <= content.length && !eof
io = StringIO.new(content.dup)
io.read(pos)
elsif pos == content.length && eof
io = StringIO.new(content.dup)
io.read(pos+1)
else
buf = ""
io = StringIO.new(buf)
io.seek pos
io.read if eof
buf << content
end
if content != io.string
p [:stringio_content, content, pos, eof, io.string]
end
if pos != io.pos
p [:stringio_pos, content, pos, eof, io.pos]
end
if eof != !io.read(0)
p [:stringio_eof, content, pos, eof, io.read(0)]
end
io
end
(0..3).each {|len|
content = "a" * len
(0..(len+1)).each {|pos|
[false, true].each {|eof|
{
:read_all => lambda {|io| io.read },
:read0 => lambda {|io| io.read(0) },
:read1 => lambda {|io| io.read(1) },
:read10 => lambda {|io| io.read(10) },
}.each {|name, fun|
f = make_io(content, pos, eof)
s = make_stringio(content, pos, eof)
rf = fun.call(f)
rs = fun.call(s)
p [name, content, pos, eof, rf, rs] unless rf == rs
}
}
}
}
--
[田中 哲][たなか あきら][Tanaka Akira]