2

Possible Duplicate:
How can I check if a Java program's input/output streams are connected to a terminal?

I'd like to be able to have a problem behave differently when being run interactively versus in an automated way. In Python, you can use sys.stdout.isatty to detect this (see this question). Is there an equivalent in Java?

Community
  • 1
  • 1
Emil Sit
  • 22,894
  • 7
  • 53
  • 75

1 Answers1

2

One option is for the automated way to define a system property on the command line. For example: -Dcom.xyz.automated=true.

Andy Thomas
  • 84,978
  • 11
  • 107
  • 151