allow specification of the input file name on the command line
[lttv.git] / trunk / masters-pmf / java_speed_test / java / read_trace.java
index 91f48fd5cc7c19bc8c54f4ef9fdf99126d2dc468..aacb08eb164835161b21c9ea6dbbbdd377b35b02 100644 (file)
@@ -3,9 +3,25 @@ import java.io.*;
 public class read_trace {
        public static void main(String[] args) {
                int tmp = 0;
+               boolean print = false;
+               String filename = "";
+
+               for(String s : args) {
+                       if(s.equals("-p")) {
+                               print = true;
+                       }
+                       else {
+                               filename = s;
+                       }
+               }
+               
+               if(filename.equals("")) {
+                       System.out.println("error: no filename specified");
+                       return;
+               }
 
                try {
-                       FileInputStream file_input = new FileInputStream ("../trace.dat");
+                       FileInputStream file_input = new FileInputStream (filename);
                        BufferedInputStream buffered_input = new BufferedInputStream(file_input);
                        DataInputStream data_input = new DataInputStream (buffered_input);
                        
This page took 0.023713 seconds and 4 git commands to generate.