Please help me to find out which function is used to run a terminal command in objective c as i used in java in following code. I want to only know that which function is use in obj c or cocoa to execute a terminal process.
Runtime rt = Runtime.getRuntime();
Process prcComile = rt.exec("javac -d F:/ F://" + fname.getText()+ ".java");
InputStream iscmp = prcComile.getErrorStream();
int cerrInt = iscmp.read();
if (cerrInt == -1) {
Process prc = rt.exec("java -cp F:/ " +fname.getText());
InputStream iserr = prc.getErrorStream();
int errInt = iserr.read();
if (errInt == -1) {
InputStream is = prc.getInputStream();
int readInt = is.read();
String allOutput = "";
while (readInt != -1) {
char ch = (char) readInt;
allOutput = allOutput + ch;
readInt = is.read();
}
txtOutput.setText(allOutput);
} else {
String errorString = "";
while (errInt != -1) {
char ch = (char) errInt;
errorString += ch;
errInt = iserr.read();
}
txtOutput.setText(errorString);
}
} else {
String errorString = "";
while (cerrInt != -1) {
char ch = (char) cerrInt;
errorString += ch;
cerrInt = iscmp.read();
}
txtOutput.setText(errorString);
}