Hi,

First of all apologies to everyone for sending my last message thrice.
Wasn't intentional and I'll do my best not to repeat that...


>             File destDir = null;
> 
>             if (absoluteLibPath != null) {
>                 destDir = new File(absoluteLibPath);
>             } else {
>                 copyJars = true;
>                 destDir = new File(workDir, libPath);
>                 destDir.mkdirs();
>             }
> 
I compiled tomcat from sources and added some debugging messages.
What I found is, that tomcat takes the else-branch which should create
the directory.
I changed this to
           } else {
                copyJars = true;
                System.err.println("WorkDir: " + workDir + "; libPath: " + libPath);
                destDir = new File(workDir, libPath);
                System.err.println("no absoluteLibPath; dest Dir: " + destDir);
                destDir.mkdirs();
                if ( !destDir.exists() ) {
                    System.err.println("destDir " + destDir + " does not exist");
                    destDir.getParentFile().mkdirs();
                    destDir.mkdirs();
                    if ( !destDir.exists() ) {
                        System.err.println("destDir " + destDir + " does not exist");
                    }
                    else {
                        System.err.println("destDir " + destDir + " does exist");
                    }
                }
            }
and it works. After the first destDir.mkdirs() destDir does not exist,
the second (two) mkdirs calls create it.

So this really seems to be some bug in javas File.mkdirs implementation
(or in the underlying libc/linux filesystem).

I'm not sure what's the best thing to do in this situation, but I'll file
a bug report for tomcat suggesting to add
                if ( !destDir.exists() ) {
                    destDir.getParentFile().mkdirs();
                    destDir.mkdirs();
                }
with an apropriate comment as a workaround...

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to