This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgcj/10403: FileInputStream(File.toUrl().getFile()) does not work


>Number:         10403
>Category:       libgcj
>Synopsis:       FileInputStream(File.toUrl().getFile()) does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 14 19:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Marilen Corciovei
>Release:        3.3 cvs
>Organization:
>Environment:
windows 2000, mingw
>Description:
The following code throws a FileNotFoundException even if the file is valid.

File file = new File(args[0]);
URL url;
if (file.exists()) {
     url = file.toURL();
}else{
     url = new URL(args[0]);
}
String fileName = url.getFile();
FileInputStream f = new FileInputStream(fileName);

File.toUrl() returns something like:
"file:/c:/thisiscool-gcc/examples/reflect/src/list" (java.io.File#779)
which is parsed at java.net.URL#331 after that the URL.getFile will return "/c:/thisiscool-gcc/examples/reflect/src/list". From this point all the problems begin.
- the exception is thrown probably in the native FileDescriptor: natFileDescriptorWin32.cc#116 implementations

The problem is probably in the FileInputStream implementation
>How-To-Repeat:
Compile the code using gcj --Main=main -o test.exe Main.java and run ./test.exe
>Fix:

The problem is probably in the FileInputStream implementation since the URL.toFile returns what it is expected.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]