Skip to content

Open

[<Interface>]
type Open =
    abstract member Invoke (path: PathLike, callback: Callback3) : unit
    abstract member Invoke (path: PathLike, flags: OpenMode option, callback: Callback2) : unit
    abstract member Invoke (path: PathLike, flags: OpenMode option, mode: OpenMode option, callback: Callback) : unit
    abstract member __promisify__ (path: PathLike, flags: OpenMode, ?mode: OpenMode) : Promise<float>
AssemblyXantham.Fable.Node

Declared inside

Callback
Callback2
Callback3

Methods

abstract member Invoke (path: PathLike, callback: Callback3) : unit

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. Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be 0o666.

Parameter
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
abstract member Invoke (path: PathLike, flags: OpenMode option, callback: Callback2) : unit

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. Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be 0o666.

Parameter
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
abstract member Invoke (path: PathLike, flags: OpenMode option, mode: OpenMode option, callback: Callback) : unit

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. Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be 0o666.

@since v0.0.2

Parameter
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
flagsSee support of file system flags``.
pathA path to a file. If a URL is provided, it must use the file: protocol.
abstract member __promisify__ (path: PathLike, flags: OpenMode, ?mode: OpenMode) : Promise<float>

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

Parameter
pathA path to a file. If a URL is provided, it must use the file: protocol.
modeA file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to 0o666.