ZenFS
    Preparing search index...

    Class InodeInternal

    Generic inode definition that can easily be serialized.

    Hierarchy

    • {
          "[toStringTag]": string;
          buffer: any;
          byteLength: number;
          byteOffset: number;
          constructor: StructConstructor<object>;
          getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
          getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
          getFloat16(byteOffset: number, littleEndian?: boolean): number;
          getFloat32(byteOffset: number, littleEndian?: boolean): number;
          getFloat64(byteOffset: number, littleEndian?: boolean): number;
          getInt16(byteOffset: number, littleEndian?: boolean): number;
          getInt32(byteOffset: number, littleEndian?: boolean): number;
          getInt8(byteOffset: number): number;
          getUint16(byteOffset: number, littleEndian?: boolean): number;
          getUint32(byteOffset: number, littleEndian?: boolean): number;
          getUint8(byteOffset: number): number;
          setBigInt64(
              byteOffset: number,
              value: bigint,
              littleEndian?: boolean,
          ): void;
          setBigUint64(
              byteOffset: number,
              value: bigint,
              littleEndian?: boolean,
          ): void;
          setFloat16(byteOffset: number, value: number, littleEndian?: boolean): void;
          setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
          setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
          setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
          setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
          setInt8(byteOffset: number, value: number): void;
          setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
          setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
          setUint8(byteOffset: number, value: number): void;
      }
      • Inode

    Implements

    Index

    Constructors

    • Parameters

      • ...args:
            | [
                _buffer?: | number
                | ArrayBufferLike
                | ArrayBufferView<ArrayBufferLike>
                | ArrayLike<number>,
                _byteOffset?: number,
                _byteLength?: number,
            ]
            | [Readonly<Partial<InodeLike<number>>>]

      Returns Inode

    Properties

    "[toStringTag]": string
    buffer: any

    The ArrayBuffer instance referenced by the array.

    byteLength: number

    The length in bytes of the array.

    byteOffset: number

    The offset in bytes of the array.

    constructor: StructConstructor<object>

    The initial value of Object.prototype.constructor is the standard built-in Object constructor.

    alignment: number
    array?: TypeArrayConstructor<BufferView<any> & ArrayBufferView<ArrayBufferLike>>
    isUnion: boolean
    name: string
    size: number

    Accessors

    __after_flags: any

    For future use

    __data_old: any

    For future use

    __ino_old: any

    For future use

    __padding: any

    Padding up to 128 bytes. This ensures there is enough room for expansion without breaking the ABI.

    atimeMs: any

    Time of last access, since epoch

    attributes: any

    Extended attributes

    birthtimeMs: any

    Time of file creation, since epoch

    ctimeMs: any

    The time the inode was changed.

    This is automatically updated whenever changed are made using update().

    data: any
    flags: any
    gid: any

    The id of the group that owns the file

    ino: any

    Inode number

    mode: any

    Unix-style file mode (e.g. 0o644) that includes the item type

    mtimeMs: any

    Time of last modification, since epoch

    nlink: any

    Number of hard links

    size: any

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

    uid: any

    The id of the user that owns the file

    version: any

    The "version" of the inode/data. Unrelated to the inode format!

    Methods

    • Gets the BigInt64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns bigint

    • Gets the BigUint64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns bigint

    • Gets the Float16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      Returns number

    • Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      Returns number

    • Stores a BigInt64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: bigint

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores a BigUint64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: bigint

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Float16 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Float32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Float64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Int16 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Int32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Int8 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      Returns void

    • Stores an Uint16 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Uint32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Stores an Uint8 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      Returns void

    • Updates the Inode using information from the stats object. Used by file systems at sync time, e.g.:

      • Program opens file and gets a File object.
      • Program mutates file. File object is responsible for maintaining metadata changes locally -- typically in a Stats object.
      • Program closes file. File object's metadata changes are synced with the file system.

      Parameters

      • Optionaldata: Partial<Readonly<InodeLike<number>>>

      Returns boolean

      whether any changes have occurred.

    • Get a value from a buffer

      Parameters

      • this: void
      • buffer: ArrayBufferLike
      • offset: number

      Returns BufferView<any> & ArrayBufferView<ArrayBufferLike>

    • Set a value in a buffer

      Parameters

      • this: void
      • buffer: ArrayBufferLike
      • offset: number
      • value: BufferView<any> & ArrayBufferView<ArrayBufferLike>

      Returns void