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

Consider exposing the UNIX inode number and Windows File ID as attributes

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows

      Description

      A DESCRIPTION OF THE PROBLEM :
      When working with hard links it can be useful to know the underlying inode number for e.g. disk space usage calculations. The current Java API allows you to test if two files are the same, but, doesn't let you get access to the underlying ID for use in things like hashmaps.

      On UNIX the inode and link counts are in fact exposed via NIO attributes, it just isn't a documented part of the spec.

      Windows assigns every file on a volume a unique 128-bit GUID, which is the equivalent of an inode number. When combined with the volume ID it's actually a true GUID that should be unique for every file in the world (neat!). The Windows NIO provider reads this value, and stores it in the WindowsFileAttributes structure, but doesn't expose it in the API.

      To aid with writing apps that use hard links, it'd be good to expose these numbers in an API stable way. The implementation cost is low because the data is already being read - the work is in defining what the API looks like.

      Alternatively, I'd also take an OpenJDK specific attribute for the Windows ID, like nlinks and ino are today.


        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: