From: Michael Malone Date: 2009-03-16T08:35:53+09:00 Subject: Re: does IO.read block? >> IMHO you can simplify that do >> >> rescue Exception => error >> Marshal.dump(error, write_end) >> end >> >> Which should also be more efficient since the looping is done in C code. > Thanks, I've applied that. >> But again, I would just do >> >> obj = Marshal.read(read_end) >> >> Which, again is more efficient since you do not need the additional >> buffer and looping is done in C code. > I need the additional buffer because an exception is not always thrown > so attempting to unmarshal an empty string causes problems > Wait, I just re-read your email. The looping is done in C. So that implies I do need to loop on the read_end.read() call? Efficiency is not a massive concern for me - correctness is. ======================================================================= This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission. =======================================================================