Date: Mon, 16 Feb 1998 10:44:22 -0800
From: Quoc Vu <qvu@bean.jpl.nasa.gov>
To: java-security@web1.javasoft.com
Subject: Runtime.exec() Perfomance
Hi There,
Can anyone tell me why stand lone application can not write to local
disk. This is my code:
import java.awt.*;
import java.io.*;
import java.lang.*;
public class TT extends Frame
{
public TT()
{
}
public static void main(String[] argv)
{
TT f = new TT();
System.out.println("Running...");
Runtime rt = Runtime.getRuntime();
try
{
Process p = rt.exec("ls -l > tt");
int ret = p.waitFor();
System.out.println("exitValue = " + ret);
}
catch (IOException e)
{
}
}
}
It runs well but never creates file tt. The c code segment below did
create a tt file. It proves that is not realated to write privilige.
#include <stdlib.h>
main()
{
system("ls -l > tt");
}
Thanks,
-- Quoc Vu qvu@bean.jpl.nasa.gov-- Quoc Vu qvu@bean.jpl.nasa.gov