ZenFS
    Preparing search index...

    Class Dirent<Name, TArrayBuffer>

    Type Parameters

    • Name extends string | Buffer = string
    • TArrayBuffer extends ArrayBufferLike = ArrayBufferLike

    Hierarchy

    Implements

    Index

    Constructors

    • Type Parameters

      • Name extends string | Buffer<ArrayBufferLike> = string
      • TArrayBuffer extends ArrayBufferLike = ArrayBufferLike

      Parameters

      • Optional_buffer: number | ArrayLike<number> | TArrayBuffer | ArrayBufferView<TArrayBuffer>
      • Optional_byteOffset: number
      • Optional_byteLength: number

      Returns Dirent<Name, TArrayBuffer>

    Properties

    _encoding?: null | "buffer" | BufferEncoding
    _parentPath: string
    "[toStringTag]": string
    buffer: TArrayBuffer
    byteLength: number
    byteOffset: number

    Accessors

    _name: any
    ino: any
    • get name(): Name

      The file name that this fs.Dirent object refers to. The type of this value is determined by the options.encoding passed to readdir or readdirSync.

      Returns Name

      v10.10.0

    • get parentPath(): string

      The path to the parent directory of the file this fs.Dirent object refers to.

      Returns string

      v20.12.0, v18.20.0

    • get path(): string

      Returns string

      Removed in Node v24, use parentPath instead.

    type: any

    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

    • Returns true if the fs.Dirent object describes a block device.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a character device.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a file system directory.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a first-in-first-out (FIFO) pipe.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a regular file.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a socket.

      Returns boolean

      v10.10.0

    • Returns true if the fs.Dirent object describes a symbolic link.

      Returns boolean

      v10.10.0

    • 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

    • Internal

      Parameters

      • path: string
      • stats: InodeLike
      • Optionalencoding: null | "buffer" | BufferEncoding

      Returns Dirent