title: IO file attributes
body: <pre><code>import java.io.File;
  class AttriDemo{
  
      public static void main(String args[]){
          File f1 = new File("FileIO/file.txt");
          System.out.println("File name           : " + f1.getName());
          System.out.println("File path           : " + f1.getPath());
          System.out.println("File AbsPath        : " + f1.getAbsolutePath());
          System.out.println("File parent         : " + f1.getParent());
          f1.setWritable(true);
          if(f1.canWrite())
          {
              System.out.println("File is Writeable");
          }
          else
          {
              System.out.println("File is not Writeable");
          }
          if(f1.canRead())
          {
              System.out.println("Is readable");
          }
          else
          {
              System.out.println("File is not readable");
          }
      }
  }
  </code></pre>
  
  <p>I the file is readable and writable in real...</p>
  
  <p>then I tried setting it to Writable explicitly but still the output shows it as the file is not writable!!</p>
  
  <p>output:</p>
  
  <pre><code>....
  The file is not writable.
  The file is not readable.
  </code></pre>
  
  <hr>
  
  <pre><code>File f1 = new File("D:/javaProgs/FileIO/AttriDemo.java");
  </code></pre>
  
  <p>doing this helps solve the problem. 
  but can someone explain how? I mean the file was in the same directory and the statements above were running just fine. e.g getName() getParent()</p>