Sure thing.

Results:
This is not a java.io.File bug, we need to check further.Created file was: /Users/erik/Documents/projects/my_project/java/ftp/res/ prefix58446sufix



On Aug 20, 2008, at 7:54 AM, David Latorre wrote:

There is a chance that is due to canWrite() returning false even if the
directory is writable. There are several bug reports at
http://bugs.sun.com/which complain about this fact (in most systems
there isn't any syscall or
function which will return this value correctly).

Erik could you try this ?

public static void main(String args[])  {
       File adminHome = new File(PATH_TO_RES_ADMIN);
       File aFile = null;
       if (!adminHome.canWrite()) {
System.out.println("Problem found: canWrite returns false");
           try {
aFile = File.createTempFile("prefix", "sufix", adminHome); System.out.println("canWrite does not work as expected in your environment, it returned false but the file " + aFile.getAbsolutePath()
+ " was created");
           } catch (IOException e) {
               System.out.println(PATH_TO_RES_ADMIN + " is actually
non-writable hence the server response. Exception: ");
               e.printStackTrace();
           }
       } else {
           try {
aFile = File.createTempFile("prefix", "sufix", adminHome); System.out.println("This is not a java.io.File bug, we need
to check further.Created file was: " + aFile.getAbsolutePath());
           } catch (IOException e) {
System.out.println("canWrite returns true but there was a
problem trying to create the  file. Exception: ");
               e.printStackTrace();

           }
       }

       if (aFile != null) {
           aFile.deleteOnExit();
       }
   }


2008/8/20 Erik Morton <[EMAIL PROTECTED]>

Yes, silly typo. ./res/admin is a directory.

I am able to get a file from ./res/admin, I just can't put a file there.


On Aug 20, 2008, at 3:45 AM, Niklas Gustavsson wrote:

Cool, you're the first case of using IPv6 with FtpServer that I've seen.

On Tue, Aug 19, 2008 at 11:31 PM, Erik Morton <[EMAIL PROTECTED]> wrote:

I created a file called ./res/admin, which is chmod 777


When you say "file", do you really mean a directory?

/niklas




Reply via email to