classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: small bug in new file code


From: Dalibor Topic
Subject: [cp-patches] Re: small bug in new file code
Date: Mon, 16 Aug 2004 00:01:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5

Jeroen Frijters wrote:
Dalibor Topic wrote:

The problem is illustrated by this example from kaffe's regression test suite:

import java.io.File;

public class FileTest {

public static void exists(File f) {
String type = "File";
if (f.isDirectory()) { type = "Directory"; }
System.out.print(type + " \"" + f.getPath() );
if (f.exists()) {
System.out.println("\" does exist");
} else {
System.out.println("\" does not exist");
}
}

public static void main(String[] argv) throws Exception {
File g5 = new File("","NotExist2"); exists(g5);
}
}

it should print File "/NotExist2" does not exist on Unix and
File "\NotExist2" does not exist on Windows.


Thanks!

I made an additional change to your patch to prevent to accidental
forming of a UNC path prefix (\\) by trimming the leading separators
from name. It's attached.

thanks a lot! Works for me on kaffe, I've checked it in there. Feel free to check it in for GNU Classpath as our cumulative patch ;)

cheers,
dalibor topic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]