Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Run the ls command in the terminal to see the uncompiled .java file

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) {
        System.out.println("Pblm found2.");
    }

    System.out.println("finished.");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Run #ls #command #terminal #uncompiled #file
ADD COMMENT
Topic
Name
3+7 =