fio/types

Types

File metadata information. Represents the intersection of info available from Erlang and JavaScript.

pub type FileInfo {
  FileInfo(
    size: Int,
    mode: Int,
    nlinks: Int,
    inode: Int,
    user_id: Int,
    group_id: Int,
    dev: Int,
    atime_seconds: Int,
    mtime_seconds: Int,
    ctime_seconds: Int,
  )
}

Constructors

  • FileInfo(
      size: Int,
      mode: Int,
      nlinks: Int,
      inode: Int,
      user_id: Int,
      group_id: Int,
      dev: Int,
      atime_seconds: Int,
      mtime_seconds: Int,
      ctime_seconds: Int,
    )

    Arguments

    size

    File size in bytes

    mode

    File mode (type + permissions encoded as 16-bit int)

    nlinks

    Number of hard links

    inode

    Inode number

    user_id

    User ID of the file’s owner

    group_id

    Group ID of the file’s group

    dev

    Device ID

    atime_seconds

    Last access time (Unix timestamp seconds)

    mtime_seconds

    Last modification time (Unix timestamp seconds)

    ctime_seconds

    Last change time (Unix timestamp seconds)

File permissions for user, group, and other.

pub type FilePermissions {
  FilePermissions(
    user: set.Set(Permission),
    group: set.Set(Permission),
    other: set.Set(Permission),
  )
}

Constructors

File type enumeration.

pub type FileType {
  File
  Directory
  Symlink
  Other
}

Constructors

  • File

    A regular file

  • Directory

    A directory

  • Symlink

    A symbolic link

  • Other

    Another special file type (socket, device, etc.)

Hashing algorithms for file checksums.

pub type HashAlgorithm {
  Sha256
  Sha512
  Md5
}

Constructors

  • Sha256
  • Sha512
  • Md5

A single file permission.

pub type Permission {
  Read
  Write
  Execute
}

Constructors

  • Read
  • Write
  • Execute

Values

pub fn file_info_permissions(info: FileInfo) -> FilePermissions

Extract FilePermissions from FileInfo.

pub fn file_info_permissions_octal(info: FileInfo) -> Int

Extract permissions octal from FileInfo.

pub fn file_info_type(info: FileInfo) -> FileType

Extract the file type from a FileInfo value.

pub fn file_permissions_to_octal(
  permissions: FilePermissions,
) -> Int

Convert FilePermissions to octal integer.

pub fn octal_to_file_permissions(octal: Int) -> FilePermissions

Convert octal permissions integer to FilePermissions.

Search Document