summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-12-11 18:00:25 +0100
committerSven Gothel <[email protected]>2014-12-11 18:00:25 +0100
commit150ea4f231c9629ef9ef354e3f1a92a516d46f91 (patch)
tree518e7172c4b4c76756b03ab87f8cccb87c2f43f2 /src
parent9e13e8c78ed69bb7afcd49abe8bf69340dc06223 (diff)
Bug 1108 - IOUtil.getTempDir(..): Difficulties to determine executable access permission on Windows via BATCH file execution
Try using explicit call to Windows 'cmd.exe' w/ referencing the BATCH file location, via 'Runtime.getRuntime().exec(new String[] { "cmd", "/c", "a.bat" } );' While the bug itself could not be reproduced here, I could test on Windows 7 (64bit and 32bit), as well as an WindowsXP 32bit that no regression occured.
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index 5f3ae01..ac011af 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -668,6 +668,14 @@ public class IOUtil {
return null;
}
}
+ private static String[] getShellCommandArgs(final String scriptFile) {
+ switch(PlatformPropsImpl.OS_TYPE) {
+ case WINDOWS:
+ return new String[] { "cmd", "/c", scriptFile };
+ default:
+ return new String[] { scriptFile };
+ }
+ }
private static boolean getOSHasNoexecFS() {
switch(PlatformPropsImpl.OS_TYPE) {
@@ -823,7 +831,7 @@ public class IOUtil {
}
// Using 'Process.exec(String[])' avoids StringTokenizer of 'Process.exec(String)'
// and hence splitting up command by spaces!
- final Process pr = Runtime.getRuntime().exec(new String[] { exetst.getCanonicalPath() } );
+ final Process pr = Runtime.getRuntime().exec( getShellCommandArgs( exetst.getCanonicalPath() ) );
/**
* Disable StreamMonitor, which throttles exec-test performance a lot!
*