Function open

  • Asynchronous file open. See the POSIX open(2) documentation for more details.

    mode sets the file mode (permission and sticky bits), but only if the file was created. On Windows, only the write permission can be manipulated; see chmod.

    The callback gets two arguments (err, fd).

    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.

    Functions based on fs.open() exhibit this behavior as well:fs.writeFile(), fs.readFile(), etc.

    Parameters

    • path: PathLike
    • Optional flags: OpenMode

      See support of file system flags``.

    • Optional mode: null | Mode
    • callback: ((err, fd) => void)
        • (err, fd): void
        • Parameters

          Returns void

    Returns void

    Since

    v0.0.2

    See

  • Asynchronous file open. See the POSIX open(2) documentation for more details.

    mode sets the file mode (permission and sticky bits), but only if the file was created. On Windows, only the write permission can be manipulated; see chmod.

    The callback gets two arguments (err, fd).

    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.

    Functions based on fs.open() exhibit this behavior as well:fs.writeFile(), fs.readFile(), etc.

    Parameters

    • path: PathLike
    • Optional flags: OpenMode

      See support of file system flags``.

    • callback: ((err, fd) => void)
        • (err, fd): void
        • Parameters

          Returns void

    Returns void

    Since

    v0.0.2

    See

  • Asynchronous file open. See the POSIX open(2) documentation for more details.

    mode sets the file mode (permission and sticky bits), but only if the file was created. On Windows, only the write permission can be manipulated; see chmod.

    The callback gets two arguments (err, fd).

    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.

    Functions based on fs.open() exhibit this behavior as well:fs.writeFile(), fs.readFile(), etc.

    Parameters

    • path: PathLike
    • callback: ((err, fd) => void)
        • (err, fd): void
        • Parameters

          Returns void

    Returns void

    Since

    v0.0.2

    See

  • Asynchronous file open. See the POSIX open(2) documentation for more details.

    mode sets the file mode (permission and sticky bits), but only if the file was created. On Windows, only the write permission can be manipulated; see chmod.

    The callback gets two arguments (err, fd).

    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.

    Functions based on fs.open() exhibit this behavior as well:fs.writeFile(), fs.readFile(), etc.

    Parameters

    Returns Promise<number>

    Since

    v0.0.2

    See

Methods

  • Asynchronous open(2) - open and possibly create a file.

    Parameters

    • path: PathLike

      A path to a file. If a URL is provided, it must use the file: protocol.

    • flags: OpenMode
    • Optional mode: null | Mode

      A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to 0o666.

    Returns Promise<number>

Generated using TypeDoc