Skip to main content

open

function open
Jump to headingopen(
path: PathLike,
flags?: string | number,
mode?: Mode,
): Promise<FileHandle>

Opens a FileHandle.

Refer to the POSIX open(2) documentation for more detail.

Some characters (< > : " / \ | ? *) are reserved under Windows as documented by Naming Files, Paths, and Namespaces. Under NTFS, if the filename contains a colon, Node.js will open a file system stream, as described by this MSDN page.

Parameters Jump to heading

optional
Jump to headingflags: string | number = 'r'

See support of file system flags``.

optional
Jump to headingmode: Mode = 0o666

Sets the file mode (permission and sticky bits) if the file is created.

Return Type Jump to heading

Promise<FileHandle>

Fulfills with a {FileHandle} object.

Back to top