/[classpath]/classpath/java/io/File.java
ViewVC logotype

Diff of /classpath/java/io/File.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53 by tromey, Wed Nov 10 03:35:35 2004 UTC revision 1.54 by jfrijters, Fri Nov 26 13:52:22 2004 UTC
# Line 144  public class File implements Serializabl Line 144  public class File implements Serializabl
144      if (! VMFile.exists(path))      if (! VMFile.exists(path))
145        return false;        return false;
146    
147      if (!VMFile.isDirectory(path))      if (VMFile.isDirectory(path))
148        return VMFile.canWrite(path);        return VMFile.canWriteDirectory(this);
149      else      else
150        try        return VMFile.canWrite(path);
         {  
           /* If the separator is '\' a DOS-style-filesystem is assumed  
              and a short name is used, otherwise use a long name.  
              WARNING: some implementation of DOS-style-filesystems also  
              accept '/' as separator. In that case the following code  
              will fail.  
           */  
           String filename = (separatorChar!='\\')?"test-dir-write":"tst";  
           File test = createTempFile(filename, null, this);  
           return (test != null && test.delete());  
         }  
       catch (IOException ioe)  
         {  
           return false;  
         }  
151    }    }
152    
153    /**    /**

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26