public void seek(long offset, int whence) throws IOException, InvalidValueException, PipeException, BadDescriptorException { Stream stream = getWriteStreamSafe(); seekInternal(stream, offset, whence); }
public void seek(long offset, int whence) throws IOException, InvalidValueException, PipeException, BadDescriptorException { Stream stream = getWriteStreamSafe(); seekInternal(stream, offset, whence); }
@Override public IRubyObject set(IRubyObject value) { if (value == get()) { return value; } if (value instanceof RubyIO) { RubyIO io = (RubyIO)value; // HACK: in order to have stdout/err act like ttys and flush always, // we set anything assigned to stdout/stderr to sync try { io.getOpenFile().getWriteStreamSafe().setSync(true); } catch (BadDescriptorException e) { throw runtime.newErrnoEBADFError(); } } if (!value.respondsTo("write")) { throw runtime.newTypeError(name() + " must have write method, " + value.getType().getName() + " given"); } return super.set(value); } }
@Override public IRubyObject set(IRubyObject value) { if (value == get()) { return value; } if (value instanceof RubyIO) { RubyIO io = (RubyIO)value; // HACK: in order to have stdout/err act like ttys and flush always, // we set anything assigned to stdout/stderr to sync try { io.getOpenFile().getWriteStreamSafe().setSync(true); } catch (BadDescriptorException e) { throw runtime.newErrnoEBADFError(); } } if (!value.respondsTo("write")) { throw runtime.newTypeError(name() + " must have write method, " + value.getType().getName() + " given"); } return super.set(value); } }
ChannelDescriptor d2 = io2.openFile.getWriteStreamSafe().getDescriptor();
ChannelDescriptor d2 = io2.openFile.getWriteStreamSafe().getDescriptor();
selfFile.getWriteStreamSafe().fflush();
selfFile.getWriteStreamSafe().fflush();