Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8022671

Revisit the Logic of Handling Devices In Java IO/NIO Functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      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.

            Unassigned Unassigned
            dxu Dan Xu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: