If I use this command inside unix shell :
ls -lrt > ttrr
I get my output.
But when I am putting that command inside a java program then it does not work, it does not give any error, but no file is created after the program execution is complete.
here is my program :
public class sam
{
public static void main(String args[])
{
try
{
Runtime.getRuntime().exec(" ls -lrt > ttrr");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}