Hi Folks:) ,
Problem: how to run unix "find" Command in Java Program using Cygwin Environment.
I have been using the Runtime & Process classes to run the unix commands in java program,i can able to run the grep ,cat command etc.. But i Couldn't able to run the "find" Command
and Redirection(>>) Operator , i dont know the Reason ..
Anyone here plz help me on this ..
Here is my code :
String s =null;
:'( line 1: String command2 = "find . -name "+search_file+ " -print";:'(
( "search_file " be the argument).
line 2: Process proc =rt.exec(find);
line 3: BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
while( ( s=br.readLine() )!=null )
{ System.out.println(" File Found : " + s); }
result after run this program is
(and the return value of "find" command is "2 " seems like Permission denied:( )