[kaffe][gump] java.io.File's delete does not remove links

Davanum Srinivas dims at yahoo.com
Sun Dec 19 15:28:43 PST 2004


This problem is killing ant's bootstrap.sh stuff. Works fine on JDK1.4.

Step #1: Set up the link as follows:
mkdir /tmp/ant
ln -s /tmp/ant /tmp/ThisIsALink

Step #2: Compile the following java source file:
import java.lang.*;
import java.io.*;
public class test {
        public static void main(String[] argv) throws Exception {
                File linkFile = new File("/tmp", "ThisIsALink");
                if (!linkFile.delete()) {
                        throw new RuntimeException("Failed to delete " + linkFile);

Step #3: run it and see the following exception:
java.lang.RuntimeException: Failed to delete /tmp/ThisIsALink
   at test.main (test.java:9)


Davanum Srinivas - http://webservices.apache.org/~dims/

Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 

More information about the kaffe mailing list