FreeSpace 和 UsableSpace

FreeSpace:

Returns the number of unallocated bytes in the partition named by this abstract path name.
The returned number of unallocated bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes.
The number of unallocated bytes is most likely to be accurate immediately after this call.
It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this virtual machine.
This method makes no guarantee that write operations to this file system will succeed.

返回此抽象路徑名命名的分區中未分配的字節數。
返回的未分配字節數是一個提示,但不能保證可以使用其中的大部分或任何字節。
在這個調用之後,未分配的字節數很可能是準確的。
任何外部I/O操作(包括在此虛擬機外部的系統上進行的操作)都可能使其不準確。
此方法無法保證對此文件系統的寫入操作會成功。

UsableSpace:
Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname.

When possible,this method checks for write permissions and other operating system restrictions and will therefore usually provide a more accurate estimate of how much new data can actually be written than getFreeSpace.
The returned number of available bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of unallocated bytes is most likely to be accurate immediately after this call.
It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this virtual machine. This method makes no guarantee that write operations to this file system will succeed.
返回此抽象路徑名命名的分區上此虛擬機可用的字節數。
如果可能,此方法將檢查寫入權限和其他操作系統限制,因此通常會比getFreeSpace更準確地估計實際可以寫入多少新數據。
返回的可用字節數是一個提示,但不能保證可以使用其中的大部分或任何字節。在這個調用之後,未分配的字節數很可能是準確的。
任何外部I/O操作(包括在此虛擬機外部的系統上進行的操作)都可能使其不準確。此方法無法保證對此文件系統的寫入操作會成功。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章