title: Does my Java Virtual Machine think that I'm under unix even when I'm on windows?
body: <p>I'm bewildered about the results that I'm obtaining in the Logcat.
  I'm trying to read a file but I'm getting a FileNotFoundException. Right now I'm hardcoding the url where the file is located. </p>
  
  <pre><code>InputStream readMyFile(String fileName){
      File file = new File("C:\\Users\\Alvaro\\workspaceEclipse\\ProyectA\\file.xml");
      //File file = new File("C:" +File.separator +"Users" +File.separator +"Alvaro" +File.separator +"workspaceEclipse" +File.separator +"ProyectA" +File.separator +"file.xml");
      System.out.println("Working Directory = " +
                System.getProperty("user.dir"));
      System.out.println(file.exists());
      System.out.println(file.canRead());
      InputStream in = null;
      try {
          in = new BufferedInputStream(new FileInputStream(file));
          if (in != null) {
              in.close();
          }
      }catch(Exception e){
          System.out.println("Error opening the file. \n" +e);
      }
      return in;
  }
  </code></pre>
  
  <p>I can see that the file is not found because, somehow, a "/" is inserted at the beginning of the url string:</p>
  
  <pre><code>/C:\Users\Alvaro\workspaceEclipse\ProyectA\file.xml: open failed: ENOENT (No such file or directory)
  </code></pre>
  
  <p>The thing is, if I use the File.separator, the output is:</p>
  
  <pre><code>/C:/Users/Alvaro/workspaceEclipse/ProyectA/file.xml: open failed: ENOENT (No such file or directory)
  </code></pre>
  
  <p>Does anyone have an idea what may be happening?</p>
  
  <p>Other information:</p>
  
  <ul>
  <li>Working directory = /</li>
  <li>file.exists() and file.canRead() obviously return false.</li>
  <li>Windows 7 Home Premium.</li>
  <li>Eclipse Version Indigo Service Release 2</li>
  <li>Java version 1.6.0_37</li>
  </ul>