public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
public boolean isatty(FileDescriptor descriptor) { return posix().isatty(descriptor); }
public boolean isatty(FileDescriptor descriptor) { return posix().isatty(descriptor); }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
public int isatty(int descriptor) { return posix().isatty(descriptor); }
public int isatty(int descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
public boolean isatty(FileDescriptor descriptor) { return posix().isatty(descriptor); }
@Override public boolean isatty() { checkClosed(); if (file == null || fileOutputStream == null) { return false; } try { return PosixModule.getPOSIX().isatty(file != null ? file.getFD() : fileOutputStream.getFD()); } catch (IOException e) { return false; } }
public static void dumpBacktrace(RubyException exception) { Ruby runtime = exception.getRuntime(); System.err.println("Backtrace generated:\n" + printBacktraceJRuby(exception, runtime.getPosix().isatty(FileDescriptor.err))); }
public static void dumpBacktrace(RubyException exception) { Ruby runtime = exception.getRuntime(); System.err.println("Backtrace generated:\n" + printBacktraceJRuby(exception, runtime.getPosix().isatty(FileDescriptor.err))); }
/** Prints an error with backtrace to the error stream. * * MRI: eval.c - error_print() * */ public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } PrintStream errorStream = getErrorStream(); errorStream.print(config.getTraceType().printBacktrace(excp, errorStream == System.err && getPosix().isatty(FileDescriptor.err))); }
/** Prints an error with backtrace to the error stream. * * MRI: eval.c - error_print() * */ public void printError(RubyException excp) { if (excp == null || excp.isNil()) { return; } PrintStream errorStream = getErrorStream(); errorStream.print(config.getTraceType().printBacktrace(excp, errorStream == System.err && getPosix().isatty(FileDescriptor.err))); }
@Override public boolean isatty() { checkClosed(); FileDescriptor fd; try { if ((fd = getInputFileDescriptor(inputStream)) == null && (fd = getOutputFileDescriptor(outputStream)) == null) { return false; } } catch (IOException e) { return false; } return PosixModule.getPOSIX().isatty(fd); }
protected void warnCircularRequire(String requireName) { runtime.getWarnings().warn("loading in progress, circular require considered harmful - " + requireName); // it's a hack for c:rb_backtrace impl. // We should introduce new method to Ruby.TraceType when rb_backtrace is widely used not only for this purpose. RaiseException ex = new RaiseException(runtime, runtime.getRuntimeError(), null, false); String trace = runtime.getInstanceConfig().getTraceType().printBacktrace(ex.getException(), runtime.getPosix().isatty(FileDescriptor.err)); // rb_backtrace dumps to stderr directly. System.err.print(trace.replaceFirst("[^\n]*\n", "")); }
protected void warnCircularRequire(String requireName) { runtime.getWarnings().warn("loading in progress, circular require considered harmful - " + requireName); // it's a hack for c:rb_backtrace impl. // We should introduce new method to Ruby.TraceType when rb_backtrace is widely used not only for this purpose. RaiseException ex = new RaiseException(runtime, runtime.getRuntimeError(), null, false); String trace = runtime.getInstanceConfig().getTraceType().printBacktrace(ex.getException(), runtime.getPosix().isatty(FileDescriptor.err)); // rb_backtrace dumps to stderr directly. System.err.print(trace.replaceFirst("[^\n]*\n", "")); }
public void checkTTY() { if (fd.realFileno != -1 && runtime.getPosix().isatty(fd.realFileno) != 0 || stdio_file != null) { boolean locked = lock(); try { mode |= TTY | DUPLEX; } finally { if (locked) unlock(); } } // Clear errno so ENOTTY does not get picked up elsewhere (jruby/jruby#4527 runtime.getPosix().errno(0); }
@JRubyMethod(name = {"tty?", "isatty"}) public RubyBoolean tty_p(ThreadContext context) { try { return context.runtime.newBoolean( context.runtime.getPosix().isatty( getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor())); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } }
@JRubyMethod(name = {"tty?", "isatty"}) public RubyBoolean tty_p(ThreadContext context) { try { return context.runtime.newBoolean( context.runtime.getPosix().isatty( getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor())); } catch (BadDescriptorException e) { throw context.runtime.newErrnoEBADFError(); } }