mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 19:05:34 +01:00
linux tweak, and improving the speed of siphoning System.out
This commit is contained in:
@@ -56,9 +56,14 @@ class PdeMessageSiphon implements Runnable {
|
||||
//System.err.println(currentLine);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("PdeMessageSiphon err " + e);
|
||||
e.printStackTrace();
|
||||
//thread.stop(); // implicit (and no longer supported)
|
||||
// on linux, a "bad file descriptor" message comes up when
|
||||
// closing an applet that's being run externally.
|
||||
// use this to cause that to fail silently since not important
|
||||
if ((PdeBase.platform != PdeBase.LINUX) ||
|
||||
(e.getMessage().indexOf("Bad file descriptor") == -1)) {
|
||||
System.err.println("PdeMessageSiphon err " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//System.err.println("siphon thread exiting");
|
||||
}
|
||||
|
||||
@@ -75,12 +75,24 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
public void run() {
|
||||
byte boofer[] = new byte[1024];
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
//int count = input.available();
|
||||
//int offset = 0;
|
||||
int count = input.read(boofer, 0, boofer.length);
|
||||
if (count == -1) break;
|
||||
System.out.print(new String(boofer, 0, count));
|
||||
}
|
||||
|
||||
/*
|
||||
int c;
|
||||
while ((c = input.read()) != -1) {
|
||||
System.out.print((char) c);
|
||||
}
|
||||
*/
|
||||
} catch (Exception e) {
|
||||
System.err.println("PdeSystemOutSiphon error " + e);
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -23,12 +23,11 @@ X open the discourse board in another window, ask to post the code
|
||||
|
||||
X set PATH to include java (!)
|
||||
X external classes currently require expert release
|
||||
_ code written for linux, test it
|
||||
X code written for linux, test it
|
||||
_ code written for windows, rebuild the exe and test it
|
||||
|
||||
_ update the release of jikes that's used
|
||||
X updated for macosx
|
||||
_ compile new version for linux
|
||||
X compile new version for linux
|
||||
_ compile new version for windows
|
||||
|
||||
_ netscape/javascript had to be included for linux and for expert
|
||||
|
||||
Reference in New Issue
Block a user