Skip to content

Dirent

[<Interface>]
type Dirent<'Name> =
    abstract member name: 'Name with get, set
    abstract member parentPath: string with get, set
    abstract member path: string with get, set
    static member Create (isFile: unit -> bool, isDirectory: unit -> bool, isBlockDevice: unit -> bool, isCharacterDevice: unit -> bool, isSymbolicLink: unit -> bool, isFIFO: unit -> bool, isSocket: unit -> bool, name: 'Name, parentPath: string, path: string) : Dirent<'Name>
    abstract member isBlockDevice () : bool
    abstract member isCharacterDevice () : bool
    abstract member isDirectory () : bool
    abstract member isFIFO () : bool
    abstract member isFile () : bool
    abstract member isSocket () : bool
    abstract member isSymbolicLink () : bool
AssemblyXantham.Fable.Node
Attributes[<Interface>]

A representation of a directory entry, which can be a file or a subdirectory within the directory, as returned by reading from an fs.Dir. The directory entry is a combination of the file name and file type pairs.

Additionally, when readdir or readdirSync is called with the withFileTypes option set to true, the resulting array is filled with fs.Dirent objects, rather than strings or Buffer s.

@since v10.10.0

Properties

abstract member name: 'Name with get, set

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.

@since v10.10.0

abstract member parentPath: string with get, set

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

@since v20.12.0, v18.20.0

abstract member path: string with get, set

Alias for dirent.parentPath.

@since v20.1.0

Methods

static member Create (isFile: unit -> bool, isDirectory: unit -> bool, isBlockDevice: unit -> bool, isCharacterDevice: unit -> bool, isSymbolicLink: unit -> bool, isFIFO: unit -> bool, isSocket: unit -> bool, name: 'Name, parentPath: string, path: string) : Dirent<'Name>
abstract member isBlockDevice () : bool

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

@since v10.10.0

abstract member isCharacterDevice () : bool

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

@since v10.10.0

abstract member isDirectory () : bool

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

@since v10.10.0

abstract member isFIFO () : bool

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

@since v10.10.0

abstract member isFile () : bool

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

@since v10.10.0

abstract member isSocket () : bool

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

@since v10.10.0

abstract member isSymbolicLink () : bool

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

@since v10.10.0