× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
SachinPrakash reported 2017-06-19T04:56:05Z  · tariqrahiman last modified 2017-06-20T18:37:31Z

Add additional Runtime.excec() methods to AquaScript


customer request
Dev
Kin-Hong Wong
kin-hong
QA
Tariq Rahiman
tariqrahiman
Priority Low
Complexity Unknown
Component Open API - General
Version 18.0

Example 1 successfully executes but Example 2 does not. The reason is that a different Runtime.exec() method needs to be called in order to successfully invoke example 2 as explained in the stackoverflow post:

https://stackoverflow.com/a/25878208

Enhancement Request: Introduce two new methods in AQSystem:

runCommand(string[] cmdarray); Invokes Runtime.exec(String[] cmdarray)
runCommand(string[] cmdarray, folder); Invokes Runtime.exec(String[] cmdarray, null, dir)

Example 1:

importPackage(java.io);
var cmd = aqua.getSystem();
var p = cmd.runCommand("/bin/bash -c 'env' 2>&1","/tmp");

var stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

var output = new Array;
        
do {
                // read the output from the command line by line
                var outline = stdInput.readLine();
                if(outline == null) { // no more data, stop
                    break;
                }
                print (outline);
                output.push(outline);
   } while(true);

stdInput.close()
                      
print ("Success");

Example 2:

importPackage(java.io);

var cmd = aqua.getSystem();
var p = cmd.runCommand("/bin/bash -c 'env && echo' 2>&1","/tmp");

var stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

var output = new Array;

do {
// read the output from the command line by line
var outline = stdInput.readLine();
if(outline == null) { // no more data, stop
break;
}
print (outline);
output.push(outline);
} while(true);

stdInput.close()

print ("Success");
1 attachment

Issue #15322

Closed
Fixed
Resolved 2017-06-19T16:05:03Z
 
 
Completion
No due date
Fixed Build 18.0.15-2, 19.0.0-alpha-48
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017