title: Created a new file in Eclipse through python script and tried to access it in the same program but the file is empty
body: <pre><code>String[] cmd = {
                  "/bin/bash",
                  "-c",
                  "python count_freqs.py gene.train &gt; gene_counts2.txt",
          };
          Runtime.getRuntime().exec(cmd);
          bufferReader.close();
          fileReader.close();
          FileReader fileReader2 =  new  FileReader("/home/mordor/workspace/GeneNamesInBiologicalText/gene_counts2");
          String newLine ;
          try (BufferedReader br = new BufferedReader(new FileReader("/home/mordor/workspace/GeneNamesInBiologicalText/gene_counts2.txt"))) {
              String line1;
              while ((line1 = br.readLine()) != null) {
                System.out.println(line1);
              }
          }*/
  </code></pre>
  
  <p>I used the <em>String cmd[]</em> to build a script to create a file called <em>gene_Counts2.text</em> which it successfully does and it's populated with a lot of text.</p>
  
  <p>But when I use a <em>filereader</em> and <em>bufferreader</em> to iterate through the text and print it, it doesn't happen cause line1 from the code is null.</p>
  
  <p>However once the program has finished running I tried iterating through the file and it works.</p>
  
  <p>So how do I access the contents of the file without having to restart my program?</p>