[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/22935] Don't work RandomAccessFile with Windows's drive p
From: |
gcc-bugzilla at gcc dot gnu dot org |
Subject: |
[Bug classpath/22935] Don't work RandomAccessFile with Windows's drive prefix |
Date: |
16 Oct 2005 01:27:43 -0000 |
Hi,
RandomAccessFile couldn't treat Windows's drive prefix correctly. For example:
RandomAccessFile f = new RandomAccessFile("/c:/tmp/test.txt","r")
This code throw FileNotFoundException. I investigated this cause. Finally I
found FileChannelImpl constructor can't treat the file path begining of '/'
with drive prefix such as "/c:/tmp/..". It should be like "c:/tmp/...".
Following patch fixed this problem.
regards,
Takashi Okamoto
ile.java.orig 2005-05-04 19:58:58.527491300 +0900
+++ java/io/RandomAccessFile.java 2005-05-04 19:59:21.046471100 +0900
@@ -122,7 +122,7 @@
s.checkWrite(fileName);
}
- ch = new FileChannelImpl (file, fdmode);
+ ch = new FileChannelImpl (new File(file).getPath(), fdmode);
fd = new FileDescriptor(ch);
out = new DataOutputStream (new FileOutputStream (fd));
in = new DataInputStream (new FileInputStream (fd));
------- Comment #1 from from-classpath at savannah dot gnu dot org 2005-05-04
21:27 -------
Sorry.
It was fixed in Classpath 0.15. Please close this report.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22935
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/22935] Don't work RandomAccessFile with Windows's drive prefix,
gcc-bugzilla at gcc dot gnu dot org <=