Class StatsCommon<T>Abstract

Common code used by both Stats and BigIntStats

Type Parameters

  • T extends number | bigint

Hierarchy

Implements

  • StatsBase<T>

Constructors

  • Provides information about a particular entry in the file system.

    Type Parameters

    • T extends number | bigint

    Parameters

    • itemType: FileType = FileType.FILE

      Type of the item (FILE, DIRECTORY, SYMLINK, or SOCKET)

    • size: number | bigint = -1

      Size of the item in bytes. For directories/symlinks, this is normally the size of the struct that represents the item.

    • Optional mode: number | bigint

      Unix-style file mode (e.g. 0o644)

    • Optional atimeMs: number | bigint

      time of last access, in milliseconds since epoch

    • Optional mtimeMs: number | bigint

      time of last modification, in milliseconds since epoch

    • Optional ctimeMs: number | bigint

      time of last time file status was changed, in milliseconds since epoch

    • Optional uid: number | bigint

      the id of the user that owns the file

    • Optional gid: number | bigint

      the id of the group that owns the file

    • Optional birthtimeMs: number | bigint

      time of file creation, in milliseconds since epoch

    Returns StatsCommon<T>

Properties

_isBigint: boolean
atimeMs: T
birthtimeMs: T
blksize: T = ...

blocksize for file system I/O

blocks: T
ctimeMs: T
dev: T = ...

ID of device containing file

fileData: Uint8Array = null

Some file systems stash data on stats objects.

gid: T = ...

group ID of owner

ino: T = ...

inode number

mode: T
mtimeMs: T
nlink: T = ...

number of hard links

rdev: T = ...

device ID (if special file)

size: T
uid: T = ...

user ID of owner

Accessors

  • get atime(): Date
  • Returns Date

  • get birthtime(): Date
  • Returns Date

  • get ctime(): Date
  • Returns Date

  • get mtime(): Date
  • Returns Date

Methods

  • Parameters

    • arg: string | number | bigint | boolean

    Returns T

  • Change the mode of the file. We use this helper function to prevent messing up the type of the file, which is encoded in mode.

    Parameters

    • mode: number

    Returns void

  • Change the owner user/group of the file. This function makes sure it is a valid UID/GID (that is, a 32 unsigned int)

    Parameters

    • uid: number | bigint
    • gid: number | bigint

    Returns void

  • Convert the current stats object into a cred object

    Parameters

    • uid: number = ...
    • gid: number = ...

    Returns Cred

  • Checks if a given user/group has access to this item

    Parameters

    • mode: number

      The request access as 4 bits (unused, read, write, execute)

    • cred: Cred

    Returns boolean

    [Boolean] True if the request has access, false if the request does not

  • Returns boolean

  • Returns boolean

  • Returns boolean

    [Boolean] True if this item is a directory.

  • Returns boolean

  • Returns boolean

    [Boolean] True if this item is a file.

  • Returns boolean

  • Returns boolean

    [Boolean] True if this item is a symbolic link (only valid through lstat)

Generated using TypeDoc