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操作(包括在此虚拟机外部的系统上进行的操作)都可能使其不准确。此方法无法保证对此文件系统的写入操作会成功。

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