1

How to use "ls *.c" command in java?

view story
linux-howto

http://stackoverflow.com – I am trying to print "*.C" files in java I use the below code public static void getFileList(){ try { String lscmd = "ls *.c"; Process p=Runtime.getRuntime().exec(lscmd); p.waitFor(); BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); String line=reader.readLine(); while(line!=null) { System.out.println(line); line=reader.readLine(); } } catch(IOException e1) { System.out.println("Pblm found1."); } catch(InterruptedException e2) { S (HowTos)