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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: