private void checkClosed(ThreadContext context) { openFile.checkClosed(); }
public OpenFile getOpenFileChecked() { checkInitialized(); openFile.checkClosed(); return openFile; }
public void READ_CHECK(ThreadContext context) { if (!READ_DATA_PENDING()) { checkClosed(); } }
public void READ_CHECK(ThreadContext context) { if (!READ_DATA_PENDING()) { checkClosed(); } }
public OpenFile getOpenFileChecked() { checkInitialized(); openFile.checkClosed(); return openFile; }
protected OpenFile getOpenFileChecked() { openFile.checkClosed(getRuntime()); return openFile; }
protected OpenFile getOpenFileChecked() { openFile.checkClosed(getRuntime()); return openFile; }
public int io_fflush(ThreadContext context) { boolean locked = lock(); try { checkClosed(); if (wbuf.len == 0) return 0; checkClosed(); while (wbuf.len > 0 && flushBuffer() != 0) { if (!waitWritable(context)) return -1; checkClosed(); } } finally { if (locked) unlock(); } return 0; }
private static IRubyObject doWait(ThreadContext context, RubyIO io, OpenFile fptr, long tv, int ops) { boolean ready = fptr.ready(context.runtime, context.getThread(), ops, tv); fptr.checkClosed(); if (ready) return io; return context.nil; }
private void readCheck(Stream stream) { if (!stream.readDataBuffered()) { openFile.checkClosed(getRuntime()); } }
private static IRubyObject doWait(ThreadContext context, RubyIO io, OpenFile fptr, long tv, int ops) { boolean ready = fptr.ready(context.runtime, context.getThread(), ops, tv); fptr.checkClosed(); if (ready) return io; return context.nil; }
private void readCheck(Stream stream) { if (!stream.readDataBuffered()) { openFile.checkClosed(getRuntime()); } }
/** * <p>Closes all open resources for the IO. It also removes * it from our magical all open file descriptor pool.</p> * * @return The IO. */ @JRubyMethod(name = "close") public IRubyObject close() { Ruby runtime = getRuntime(); openFile.checkClosed(runtime); return ioClose(runtime); }
/** * <p>Closes all open resources for the IO. It also removes * it from our magical all open file descriptor pool.</p> * * @return The IO. */ @JRubyMethod(name = "close") public IRubyObject close() { Ruby runtime = getRuntime(); openFile.checkClosed(runtime); return ioClose(runtime); }
@Override @JRubyMethod public IRubyObject close(final ThreadContext context) { if (getOpenFile() != null) { if (isClosed()) return context.nil; openFile.checkClosed(); return rbIoClose(context); } return context.nil; }
@Override @JRubyMethod public IRubyObject close(final ThreadContext context) { if (getOpenFile() != null) { if (isClosed()) return context.nil; openFile.checkClosed(); return rbIoClose(context); } return context.nil; }
public void checkWritable(ThreadContext context) { boolean locked = lock(); try { checkClosed(); if ((mode & WRITABLE) == 0) { throw context.runtime.newIOError("not opened for writing"); } if (rbuf.len != 0) { unread(context); } } finally { if (locked) unlock(); } }
public void checkWritable(ThreadContext context) { boolean locked = lock(); try { checkClosed(); if ((mode & WRITABLE) == 0) { throw context.runtime.newIOError("not opened for writing"); } if (rbuf.len != 0) { unread(context); } } finally { if (locked) unlock(); } }
@JRubyMethod public IRubyObject stat(ThreadContext context) { openFile.checkClosed(context.runtime); try { return context.runtime.newFileStat(getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor()); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } }
@JRubyMethod public IRubyObject stat(ThreadContext context) { openFile.checkClosed(context.runtime); try { return context.runtime.newFileStat(getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor()); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } }