Added in API level 1

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
StatFs(path: String!)

Construct a new StatFs for looking at the stats of the filesystem at path.

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
restat(path: String!)

Perform a restat of the file system referenced by this object.

Public constructors

StatFs

Added in API level 1
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

Added in API level 1
Deprecated in API level 18
open fun getAvailableBlocks(): Int

Deprecated: Use getAvailableBlocksLong() instead.

getAvailableBlocksLong

Added in API level 18
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

Added in API level 18
open fun getAvailableBytes(): Long

The number of bytes that are free on the file system and available to applications.

getBlockCount

Added in API level 1
Deprecated in API level 18
open fun getBlockCount(): Int

Deprecated: Use getBlockCountLong() instead.

getBlockCountLong

Added in API level 18
open fun getBlockCountLong(): Long

The total number of blocks on the file system. This corresponds to the Unix statvfs.f_blocks field.

getBlockSize

Added in API level 1
Deprecated in API level 18
open fun getBlockSize(): Int

Deprecated: Use getBlockSizeLong() instead.

getBlockSizeLong

Added in API level 18
open fun getBlockSizeLong(): Long

The size, in bytes, of a block on the file system. This corresponds to the Unix statvfs.f_frsize field.

getFreeBlocks

Added in API level 1
Deprecated in API level 18
open fun getFreeBlocks(): Int

Deprecated: Use getFreeBlocksLong() instead.

getFreeBlocksLong

Added in API level 18
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

Added in API level 18
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

Added in API level 18
open fun getTotalBytes(): Long

The total number of bytes supported by the file system.

restat

Added in API level 1
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