JDK-4207599 : (1.1) java.io.File does not handle drive-relative paths (win32)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1999-02-01
  • Updated: 1999-02-05
  • Resolved: 1999-02-05
Related Reports
Relates :  
Description

Name: dbT83986			Date: 02/01/99


On the NT or Win95 side, it allows you to attempt to create a file with a colon in the filename. This is allowed on Unix side but
not on PC side. On PC side, this should be recognized and forced to evaluate the colon as a drive letter indicator, defaulting to
present directory on that drive. This doesn't happen.

"c:autoexec.bat" tries to make a file in current directory named "c:autoexec.bat". It should recognize on PC side that the colon
designates C-drive, and default to current directory on C-drive. So if current directory on C-drive is FRED, the resulting file
should be created:

c:\FRED\autoexec.bat

(Review ID: 37052)
======================================================================

Comments
WORK AROUND Name: dbT83986 Date: 02/01/99 Need to check what type of operating system currently on, then the parse should include a filter for a colon (:) on the PC side of things. ======================================================================
11-06-2004

EVALUATION I assume that the submitter means that the File class does not parse drive-specific root directories correctly. That is, expressions such as new File("c:foo.txt").getCanonicalPath() return results such as "D:\temp\c:foo.txt". This has been fixed in 1.2 (see bug 4070044) but will not be fixed in 1.1.x because doing so would introduce too many incompatibilities. Note that if you open a FileOutputStream with the argument "c:foo.txt" then you'll get a file "foo.txt" in the current directory of the C: drive. This works correctly in both 1.1.7 and 1.2. -- mr@eng 1999/2/5
02-07-0171