jnr.posix.POSIX.isatty()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中jnr.posix.POSIX.isatty()方法的一些代码示例,展示了POSIX.isatty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.isatty()方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称:POSIX
方法名:isatty

POSIX.isatty介绍

暂无

代码示例

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

  1. public boolean isatty(FileDescriptor descriptor) {
  2. try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); }
  3. }

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

  1. public boolean isatty(FileDescriptor descriptor) {
  2. return posix().isatty(descriptor);
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public boolean isatty(FileDescriptor descriptor) {
  2. return posix().isatty(descriptor);
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public boolean isatty(FileDescriptor descriptor) {
  2. try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); }
  3. }

代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep

  1. public boolean isatty(FileDescriptor descriptor) {
  2. try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); }
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public int isatty(int descriptor) {
  2. return posix().isatty(descriptor);
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public int isatty(int descriptor) {
  2. try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

  1. public boolean isatty(FileDescriptor descriptor) {
  2. try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); }
  3. }

代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep

  1. public boolean isatty(FileDescriptor descriptor) {
  2. return posix().isatty(descriptor);
  3. }

代码示例来源:origin: org.python/jython

  1. @Override
  2. public boolean isatty() {
  3. checkClosed();
  4. if (file == null || fileOutputStream == null) {
  5. return false;
  6. }
  7. try {
  8. return PosixModule.getPOSIX().isatty(file != null
  9. ? file.getFD() : fileOutputStream.getFD());
  10. } catch (IOException e) {
  11. return false;
  12. }
  13. }

代码示例来源:origin: org.jruby/jruby-core

  1. public static void dumpBacktrace(RubyException exception) {
  2. Ruby runtime = exception.getRuntime();
  3. System.err.println("Backtrace generated:\n" + printBacktraceJRuby(exception, runtime.getPosix().isatty(FileDescriptor.err)));
  4. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public static void dumpBacktrace(RubyException exception) {
  2. Ruby runtime = exception.getRuntime();
  3. System.err.println("Backtrace generated:\n" + printBacktraceJRuby(exception, runtime.getPosix().isatty(FileDescriptor.err)));
  4. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /** Prints an error with backtrace to the error stream.
  2. *
  3. * MRI: eval.c - error_print()
  4. *
  5. */
  6. public void printError(RubyException excp) {
  7. if (excp == null || excp.isNil()) {
  8. return;
  9. }
  10. PrintStream errorStream = getErrorStream();
  11. errorStream.print(config.getTraceType().printBacktrace(excp, errorStream == System.err && getPosix().isatty(FileDescriptor.err)));
  12. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. /** Prints an error with backtrace to the error stream.
  2. *
  3. * MRI: eval.c - error_print()
  4. *
  5. */
  6. public void printError(RubyException excp) {
  7. if (excp == null || excp.isNil()) {
  8. return;
  9. }
  10. PrintStream errorStream = getErrorStream();
  11. errorStream.print(config.getTraceType().printBacktrace(excp, errorStream == System.err && getPosix().isatty(FileDescriptor.err)));
  12. }

代码示例来源:origin: org.python/jython

  1. @Override
  2. public boolean isatty() {
  3. checkClosed();
  4. FileDescriptor fd;
  5. try {
  6. if ((fd = getInputFileDescriptor(inputStream)) == null
  7. && (fd = getOutputFileDescriptor(outputStream)) == null) {
  8. return false;
  9. }
  10. } catch (IOException e) {
  11. return false;
  12. }
  13. return PosixModule.getPOSIX().isatty(fd);
  14. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. protected void warnCircularRequire(String requireName) {
  2. runtime.getWarnings().warn("loading in progress, circular require considered harmful - " + requireName);
  3. // it's a hack for c:rb_backtrace impl.
  4. // We should introduce new method to Ruby.TraceType when rb_backtrace is widely used not only for this purpose.
  5. RaiseException ex = new RaiseException(runtime, runtime.getRuntimeError(), null, false);
  6. String trace = runtime.getInstanceConfig().getTraceType().printBacktrace(ex.getException(), runtime.getPosix().isatty(FileDescriptor.err));
  7. // rb_backtrace dumps to stderr directly.
  8. System.err.print(trace.replaceFirst("[^\n]*\n", ""));
  9. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. protected void warnCircularRequire(String requireName) {
  2. runtime.getWarnings().warn("loading in progress, circular require considered harmful - " + requireName);
  3. // it's a hack for c:rb_backtrace impl.
  4. // We should introduce new method to Ruby.TraceType when rb_backtrace is widely used not only for this purpose.
  5. RaiseException ex = new RaiseException(runtime, runtime.getRuntimeError(), null, false);
  6. String trace = runtime.getInstanceConfig().getTraceType().printBacktrace(ex.getException(), runtime.getPosix().isatty(FileDescriptor.err));
  7. // rb_backtrace dumps to stderr directly.
  8. System.err.print(trace.replaceFirst("[^\n]*\n", ""));
  9. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public void checkTTY() {
  2. if (fd.realFileno != -1 && runtime.getPosix().isatty(fd.realFileno) != 0
  3. || stdio_file != null) {
  4. boolean locked = lock();
  5. try {
  6. mode |= TTY | DUPLEX;
  7. } finally {
  8. if (locked) unlock();
  9. }
  10. }
  11. // Clear errno so ENOTTY does not get picked up elsewhere (jruby/jruby#4527
  12. runtime.getPosix().errno(0);
  13. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = {"tty?", "isatty"})
  2. public RubyBoolean tty_p(ThreadContext context) {
  3. try {
  4. return context.runtime.newBoolean(
  5. context.runtime.getPosix().isatty(
  6. getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor()));
  7. } catch (BadDescriptorException e) {
  8. throw context.runtime.newErrnoEBADFError();
  9. }
  10. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. @JRubyMethod(name = {"tty?", "isatty"})
  2. public RubyBoolean tty_p(ThreadContext context) {
  3. try {
  4. return context.runtime.newBoolean(
  5. context.runtime.getPosix().isatty(
  6. getOpenFileChecked().getMainStreamSafe().getDescriptor().getFileDescriptor()));
  7. } catch (BadDescriptorException e) {
  8. throw context.runtime.newErrnoEBADFError();
  9. }
  10. }

相关文章

POSIX类方法