# Module `posix.sys.statvfs`

Retrieve File System Information.

Where supported by the underlying system, query the file system. If the module loads, but there is no kernel support, then `posix.sys.statvfs.version` will be set, but the unsupported APIs will be `nil`.

## Functions

statvfs (path) | Get file system statistics.

## Tables

PosixStatvfs | Files system information record.

## Constants

posix.sys.statvfs | Statvfs constants.

## Functions

statvfs (path)
  Get file system statistics.

  ### Parameters:

  - path string any path within the mounted file system

  ### Returns:

  PosixStatvfs information about file system containing path, if successful

  ### Or

  1. nil
  2. string error message
  3. int errnum

  ### See also:

  statvfs(3)

  ### Usage:

      local statvfs = require "posix.sys.statvfs".statvfs
      for a, b in pairs (statvfs "/") do print (a, b) end

## Tables

PosixStatvfs
  Files system information record.

  ### Fields:

  - f_bsize int file system block size
  - f_frsize int fundamental file system block size
  - f_blocks int number of *f_frsize* sized blocks in file system
  - f_bfree int number of free blocks
  - f_bavail int number of free blocks available to non-privileged process
  - f_files int number of file serial numbers
  - f_ffree int number of free file serial numbers
  - f_favail int number of free file serial numbers available
  - f_fsid int file system id
  - f_flag int flag bits
  - f_namemax int maximum filename length

## Constants

posix.sys.statvfs
  Statvfs constants. Any constants not available in the underlying system will be `nil` valued.

  ### Fields:

  - ST_RDONLY int read-only file system
  - ST_NOSUID int does not support `S_ISUID` nor `S_ISGID` file mode bits

  ### Usage:

      -- Print statvfs constants supported on this host.
      for name, value in pairs (require "posix.sys.statvfs") do
        if type (value) == "number" then
          print (name, value)
         end
      end

generated by LDoc 1.5.0 Last updated 2023-06-16 20:19:12