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: Jeroen Frijters
Subject: [cp-patches] RE: small bug in new file code
Date: Thu, 12 Aug 2004 09:00:39 +0200

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.

Regards,
Jeroen

Attachment: File.patch
Description: File.patch


reply via email to

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