title: How can I know a file exists or not?
body: <p>I wrote this code on android to learn whether a .txt file exists or not.</p>
  
  <pre><code>    File file_a =new File("a.txt");
  
   InputStream in3 = getResources().openRawResource(R.raw.b);
           FileOutputStream out3 = null;
  
  
          try {   out3=openFileOutput("a.txt",Context.MODE_WORLD_WRITEABLE);
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } 
           byte[] buff3 = new byte[1024];
           int read3 = 0; 
  
           try {
              while ((read3 = in3.read(buff3)) &gt; 0) {
                 out3.write(buff3, 0, read3);
              }
           } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace(); 
          } finally {
                try {
                  in3.close();
                  out3.close();
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
           }
  
      boolean a=file_a.exists();
  </code></pre>
  
  <p>It always returns <code>false</code>.</p>
  
  <p>How can I fix this?</p>