[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bug #12963] Don't work RandomAccessFile with Windows's driv
From: |
anonymous |
Subject: |
[commit-cp] [bug #12963] Don't work RandomAccessFile with Windows's drive prefix |
Date: |
Wed, 4 May 2005 11:04:52 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.7.5) Gecko/20041108 Firefox/1.0 |
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12963>
Summary: Don't work RandomAccessFile with Windows's drive
prefix
Project: classpath
Submitted by: None
Submitted on: Wed 05/04/05 at 07:04
Category: classpath
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Platform Version: Windows XP
_______________________________________________________
Details:
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));
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12963>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [commit-cp] [bug #12963] Don't work RandomAccessFile with Windows's drive prefix,
anonymous <=