file_streams/file_info

Types

The info that can be obtained for a file stream with file_stream.read_file_info().

On Windows, the fields that are specific to Unix hold placeholder values: uid and gid are always 0, mode and access are based on the file’s read-only attribute, and on Erlang inode and minor_device are also always 0.

pub type FileInfo {
  FileInfo(
    size: option.Option(Int),
    type_: option.Option(file_type.FileType),
    access: option.Option(file_access.FileAccess),
    atime: option.Option(Int),
    mtime: option.Option(Int),
    ctime: option.Option(Int),
    mode: option.Option(Int),
    links: option.Option(Int),
    major_device: option.Option(Int),
    minor_device: option.Option(Int),
    inode: option.Option(Int),
    uid: option.Option(Int),
    gid: option.Option(Int),
  )
}

Constructors

  • FileInfo(
      size: option.Option(Int),
      type_: option.Option(file_type.FileType),
      access: option.Option(file_access.FileAccess),
      atime: option.Option(Int),
      mtime: option.Option(Int),
      ctime: option.Option(Int),
      mode: option.Option(Int),
      links: option.Option(Int),
      major_device: option.Option(Int),
      minor_device: option.Option(Int),
      inode: option.Option(Int),
      uid: option.Option(Int),
      gid: option.Option(Int),
    )

    Arguments

    size

    The size of the file in bytes.

    type_

    The type of the file.

    access

    The access the current process has to the file. This is worked out from the file’s owner, group, and other permission bits, using the process’s effective user and group IDs. Other ways of getting access aren’t taken into account, such as running as root, supplementary groups, and ACLs.

    This is None on Deno if the --allow-sys permission hasn’t been granted, because it’s needed to get the process’s user and group IDs.

    atime

    The time the file was last read, in whole seconds since the Unix epoch.

    mtime

    The time the file was last written, in whole seconds since the Unix epoch.

    ctime

    The time the file’s metadata was last changed, in whole seconds since the Unix epoch. On Erlang on Windows, this is the file’s creation time instead.

    mode

    The file’s permissions as the sum of the Unix permission bits, which may also include bits for the file’s type.

    links

    The number of hard links to the file.

    major_device

    The ID of the device that holds the file system the file is on, i.e. st_dev.

    minor_device

    The device ID if the file is a character or block device, i.e. st_rdev.

    inode

    The file’s inode number.

    uid

    The ID of the user who owns the file.

    gid

    The ID of the group that owns the file.

✨ Search Document