StatFs
open class StatFs
kotlin.Any | |
↳ | android.os.StatFs |
Retrieve overall information about the space on a filesystem. This is a wrapper for Unix statvfs().
Summary
Public constructors | |
---|---|
Construct a new StatFs for looking at the stats of the filesystem at |
Public methods | |
---|---|
open Int | |
open Long |
The number of blocks that are free on the file system and available to applications. |
open Long |
The number of bytes that are free on the file system and available to applications. |
open Int | |
open Long |
The total number of blocks on the file system. |
open Int | |
open Long |
The size, in bytes, of a block on the file system. |
open Int | |
open Long |
The total number of blocks that are free on the file system, including reserved blocks (that are not available to normal applications). |
open Long |
The number of bytes that are free on the file system, including reserved blocks (that are not available to normal applications). |
open Long |
The total number of bytes supported by the file system. |
open Unit |
Perform a restat of the file system referenced by this object. |
Public constructors
StatFs
StatFs(path: String!)
Construct a new StatFs for looking at the stats of the filesystem at path
. Upon construction, the stat of the file system will be performed, and the values retrieved available from the methods on this class.
Parameters | |
---|---|
path |
String!: path in the desired file system to stat. |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the file system access fails |
Public methods
getAvailableBlocks
open fungetAvailableBlocks(): Int
Deprecated: Use getAvailableBlocksLong()
instead.
getAvailableBlocksLong
open fun getAvailableBlocksLong(): Long
The number of blocks that are free on the file system and available to applications. This corresponds to the Unix statvfs.f_bavail
field.
getAvailableBytes
open fun getAvailableBytes(): Long
The number of bytes that are free on the file system and available to applications.
getBlockCountLong
open fun getBlockCountLong(): Long
The total number of blocks on the file system. This corresponds to the Unix statvfs.f_blocks
field.
getBlockSizeLong
open fun getBlockSizeLong(): Long
The size, in bytes, of a block on the file system. This corresponds to the Unix statvfs.f_frsize
field.
getFreeBlocksLong
open fun getFreeBlocksLong(): Long
The total number of blocks that are free on the file system, including reserved blocks (that are not available to normal applications). This corresponds to the Unix statvfs.f_bfree
field. Most applications will want to use getAvailableBlocksLong()
instead.
getFreeBytes
open fun getFreeBytes(): Long
The number of bytes that are free on the file system, including reserved blocks (that are not available to normal applications). Most applications will want to use getAvailableBytes()
instead.
getTotalBytes
open fun getTotalBytes(): Long
The total number of bytes supported by the file system.
restat
open fun restat(path: String!): Unit
Perform a restat of the file system referenced by this object. This is the same as re-constructing the object with the same file system path, and the new stat values are available upon return.
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the file system access fails |