JDK-8022671 : Revisit the Logic of Handling Devices In Java IO/NIO Functions
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2013-08-08
  • Updated: 2018-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
All file operations in IO and NIO area are working fine and well tested if the input is a real file. But if the input is a device, some operation may work incorrectly. The logic on how to handling devices, especially on Windows platforms, need to be revisited.

Here are some examples for the reserved names on windows.

File f = new File("nul");
f.getCanonicalPath(); // This is fixed in jdk-4858457
f.getAbsolutePath();
f.toPath().toAbsolutePath();
f.toPath().toRealPath();

In addition, when opening a file, if the file is a device, the operation flags shall be set correctly. For example, OPEN_EXISTING flag is usually used in such situation.