FstatfsSync
Bun

function

fs.statfsSync

function statfsSync(
path: PathLike,
options?: StatFsOptions & { bigint: false }

Synchronous statfs(2). Returns information about the mounted file system which contains path.

In case of an error, the err.code will be one of Common System Errors.

@param path

A path to an existing file or directory on the file system to be queried.

function statfsSync(
path: PathLike,
options: StatFsOptions & { bigint: true }

Synchronous statfs(2). Returns information about the mounted file system which contains path.

In case of an error, the err.code will be one of Common System Errors.

@param path

A path to an existing file or directory on the file system to be queried.

function statfsSync(
path: PathLike,
options?: StatFsOptions

Synchronous statfs(2). Returns information about the mounted file system which contains path.

In case of an error, the err.code will be one of Common System Errors.

@param path

A path to an existing file or directory on the file system to be queried.

Referenced types

type PathLike = string | Buffer | URL

Valid types for path values in "fs".

interface StatFsOptions

class StatsFs

Provides information about a mounted file system.

Objects returned from statfs and its synchronous counterpart are of this type. If bigint in the options passed to those methods is true, the numeric values will be bigint instead of number.

StatFs {
  type: 1397114950,
  bsize: 4096,
  blocks: 121938943,
  bfree: 61058895,
  bavail: 61058895,
  files: 999,
  ffree: 1000000
}

bigint version:

StatFs {
  type: 1397114950n,
  bsize: 4096n,
  blocks: 121938943n,
  bfree: 61058895n,
  bavail: 61058895n,
  files: 999n,
  ffree: 1000000n
}
  • bavail: number

    Available blocks for unprivileged users

  • bfree: number

    Free blocks in file system.

  • blocks: number

    Total data blocks in file system.

  • bsize: number

    Optimal transfer block size.

  • ffree: number

    Free file nodes in file system.

  • files: number

    Total file nodes in file system.

  • type: number

    Type of file system.

interface BigIntStatsFs

  • bavail: bigint

    Available blocks for unprivileged users

  • bfree: bigint

    Free blocks in file system.

  • blocks: bigint

    Total data blocks in file system.

  • bsize: bigint

    Optimal transfer block size.

  • ffree: bigint

    Free file nodes in file system.

  • files: bigint

    Total file nodes in file system.

  • type: bigint

    Type of file system.