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

File.getFreeSpace violates specification if quotas are in effect (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 24
    • core-libs
    • None
    • b10
    • windows

      Concerning the value returned by getFreeSpace, its specification states:

      "This value will be less than or equal to the total file system size returned by getTotalSpace()."

      The value returned by getFreeSpace however is obtained from the TotalNumberOfFreeBytes parameter

      "[...] a variable that receives the total number of free bytes on a disk"

      of the GetDiskFreeSpaceExW function, which does not account for quotas, whereas the value returned by getTotalSpace is derived from the TotalNumberOfBytes parameter which, per its specification, is subject to quotas:

      "If per-user quotas are being used, this value may be less than the total number of bytes on a disk."

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: