public static void Close(RubyIO /*!*/ self) { if (self.Closed) { throw RubyExceptions.CreateIOError("closed stream"); } self.Close(); }
internal static object TryInvokeOpenBlock(RubyContext /*!*/ context, BlockParam /*!*/ block, RubyIO /*!*/ io) { if (block == null) { return(io); } using (io) { object result; block.Yield(io, out result); io.Close(); return(result); } }
public static void Close(RubyIO/*!*/ self) { if (self.Closed) { throw RubyExceptions.CreateIOError("closed stream"); } self.Close(); }
internal static object TryInvokeOpenBlock(RubyContext/*!*/ context, BlockParam/*!*/ block, RubyIO/*!*/ io) { if (block == null) return io; using (io) { object result; block.Yield(io, out result); io.Close(); return result; } }
// TODO: should call File#initialize private static object OpenWithBlock(BlockParam/*!*/ block, RubyIO file) { try { object result; block.Yield(file, out result); return result; } finally { file.Close(); } }