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."
"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."
- relates to
-
JDK-8024695 new File("").exists() returns false whereas it is the current working directory
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/1a74ee64
-
Review(master) openjdk/jdk/23377