This is the mail archive of the
cygwin
mailing list for the Cygwin project.
stty on Cygwin in java program
- From: Jin Zhao <jin dot x dot zhao at oracle dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 8 Jul 2013 11:53:31 +0000 (UTC)
- Subject: stty on Cygwin in java program
Hi,
When run 'stty -echo' from java application on Cygwin, I got the error
meesage "stty: standard input: Inappropriate ioctl for device", but it is OK
when run it from Cygwin terminal. Any idea? Thanks.
Test program is as bellow:
-------------------------------------------
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class TestSttyCygwin {
public static void main(String[] args) {
String[] cmd = new String[]{"c:/cygwin/bin/bash.exe", "-c", "stty
-echo"};
try {
Process proc = Runtime.getRuntime().exec(cmd);
String s = null;
StringBuilder sb = new StringBuilder();
BufferedReader stdInput =
new BufferedReader(new
InputStreamReader(proc.getInputStream()));
while ((s = stdInput.readLine()) != null) {
sb.append(s);
}
BufferedReader stdError =
new BufferedReader(new
InputStreamReader(proc.getErrorStream()));
while ((s = stdError.readLine()) != null) {
sb.append(s);
}
proc.waitFor();
System.out.println(sb.toString());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple