[#38020] irb で %W(#{...}) — yoshihisa masuda <sacong@...>
マスダといいます。
[#38036] undef variable — hirocy <hirocy@...>
hirocyです.
[#38039] proc method — "K.Sasada" <ko1@...>
こんにちは。ささだです。
[#38056] ファイル書換え? — 中村文建 <tx6f-nkmr@...>
初めまして、MLに参加させて頂く中村と申します。
[#38057] [ANN] Ruby-GNOME2-0.6.0 — Masao Mutoh <mutoh@...>
むとうです。
[#38059] [ANN] rbbr-0.3.0 — Masao Mutoh <mutoh@...>
むとうです。
[#38073] module extendable? — Takeshi Horinouchi <horinout@...>
堀之内と申します。
[#38080] ポートが閉じているときの例外など — Mitsuru Ogino <ogino@...>
荻野と申します。いつも質問や要望ばかりですみません。
なかだです。
いわおかです。
荻野です。
なかだです。
いわおかです。
In message <20030812150516.GV37221@barber.fe.rn.tuat.ac.jp>
中川と申します。
In message <20030814.140757.707824131.tetsuo@sapphire.siz.nes.nec.co.jp>
なかだです。
In message <200308160517.h7G5HcPL012839@sharui.nakada.kanuma.tochigi.jp>
なかだです。
In message <200308180959.h7I9xnb7001977@sharui.nakada.kanuma.tochigi.jp>
なかだです。
まつもと ゆきひろです
[#38090] ruby-1.8 で eruby が SEGV — Kazuhiko <kazuhiko@...>
かずひこです。
[#38104] XMLRPC::ModRubyServer — OHARA Shigeki <os@...>
大原です。
[#38122] ruby-tcpwrap and mkmf.rb — Takahiro Kambe <taca@...>
こんにちは。
At Sat, 16 Aug 2003 12:51:55 +0900,
In message <200308160518.h7G5IXPL012842@sharui.nakada.kanuma.tochigi.jp>
なかだです。
In message <200308160714.h7G7ErPL014647@sharui.nakada.kanuma.tochigi.jp>
前田です。
In message <87d6f3znlc.wl@kirk.priv.netlab.jp>
前田です。
わたなべです。
[#38164] Ruby1.8.0でRuby-PostgreSQLがビルドできない — kensaku Maki <sakaki@...>
はじめまして、まきと申します。
[#38183] String << の動作につきまして — kuto@...
うと と申します。
たけ(tk)です。
ふなばです。
たけ(tk)です。
ふなばです。
たけ(tk)です。
ふなばです。
ども、西啓一朗@Ktouth Brand. です。
ふなばです。
ども、西啓一朗@Ktouth Brand. です。
[#38195] 理解の進め方(Re: String << の動作につきまして) — Tadashi Oh-Ya <toy@...>
おおやです。
たけ(tk)です。
In "[ruby-list:38206] 理解の進め方:シュールな世界"
たけ(tk)です
[#38198] Tmailで送るメールに日付がつけられなくなりました — 川田誠司 <kawada.seiji@...>
はじめまして
[#38256] かみ砕いた説明をすべき範囲 — 西 啓一朗 <receiver@...>
ども。西啓一朗@Ktouth Brand. です。
なかだです。
たけ(tk)です
なかだです。
たけ(tk)です
いわおかです。
たけ(tk)です
まつもと ゆきひろです
たけ(tk)です。
たけ(tk)です。
[ruby-list:38114] IO の close
荻野です。
On 2003.8.14, at 13:52 Asia/Tokyo, Minero Aoki wrote:
> あと、#finish で IOError を投げたりしますけど、
これで思い出したんですが、前から疑問だったんで、この機会に質問
させてください。
リファレンスマニュアルには、
close
入出力ポートをクローズします。以後のこのポートに対する入
出力操作は例外を発生します。ガーベージコレクトの際にはク
ローズされていないIOポートはクローズされます。
Traps:closeをGCにまかせる
self がパイプでプロセスにつながっていれば、そのプロセス
の終了を待ち合わせます。
nil を返します。
<http://www.ruby-lang.org/ja/man-1.6/index.cgi?cmd=view;name=IO>
とのみあり、close の失敗時については触れていません。が、例えば
Debian GNU/Linux Woody の man 2 close には、
RETURN VALUE
close returns zero on success, or -1 if an error occurred.
(snip)
NOTES
Not checking the return value of close is a common but
nevertheless serious programming error. File system
implementations which use techniques as ``write-behind''
to increase performance may lead to write(2) succeeding,
although the data has not been written yet. The error
status may be reported at a later write operation, but it
is guaranteed to be reported on closing the file. Not
checking the return value when closing the file may lead
to silent loss of data. This can especially be observed
with NFS and disk quotas.
A successful close does not guarantee that the data has
been successfully saved to disk, as the kernel defers
writes. It is not common for a filesystem to flush the
buffers when the stream is closed. If you need to be sure
that the data is physically stored use fsync(2) or
sync(2), they will get you closer to that goal (it will
depend on the disk hardware at this point).
とありますが、IO の close は nil を返すとのみあります。
もし、IOError とかを発生させないのであれば、Ruby ではNFS や quota
が絡むと IO は安心して使えないということになりはしないでしょうか。
例外があがるのであれば、これまたリファレンスマニュアルに明記してあ
ると助かります。
qmail の Maildir 関連を読んだのがきっかけです。これらによると
fsync(2) して返値をチェックして close(2) して返値をチェックすべき、
とあります。
<http://man.qmail.jp/jman5/maildir.html>
また Perl (5.005/5.6.1) で man perlfunc すると、
close FILEHANDLE
close Closes the file or pipe associated with the file
handle, returning true only if stdio successfully
flushes buffers and closes the system file
descriptor.
とあり、やはり成功かどうかを返すようです。
# もちろん、Ruby では例外の方が良いと思いますが。
すみませんが、気になるので教えていただければ幸いです。
--
荻野 充 (おぎの みつる) ... 「萩(はぎ)」にあらず
Verama Systems
Key fingerprint = 7F26 5414 1805 F31B 1617 10B7 C117 07AE 1691 9BD1