WritableFilesystemAPI

Node API: fs (Writable)

Inheritors

Functions

Link copied to clipboard
abstract fun copyFile(src: Value, dest: Value, callback: Value)

Copies the contents at the provided src path to the provided dest path. callback is dispatched once the copy operation completes.

abstract fun copyFile(src: Path, dest: Path, mode: Int = 0, callback: (Throwable?) -> Unit? = null)
abstract fun copyFile(src: Value, dest: Value, mode: Value?, callback: Value)

Copies the contents at the provided src path to the provided dest path, using the given mode (if specified) as modifiers for the copy operation; default value for mode is 0.

Link copied to clipboard
abstract fun copyFileSync(src: Value, dest: Value)

Copies the contents at the provided src path to the provided dest path.

abstract fun copyFileSync(src: Path, dest: Path, mode: Int = 0)
abstract fun copyFileSync(src: Value, dest: Value, mode: Value?)

Copies the contents at the provided src path to the provided dest path, using the given mode (if specified) as modifiers for the copy operation; default value for mode is 0.

Link copied to clipboard
abstract fun mkdir(path: Value, callback: Value?)
abstract fun mkdir(path: Value, options: Value?, callback: Value?)

Create a directory, asynchronously, specified by the provided path.

abstract fun mkdir(path: Path, options: MkdirOptions = MkdirOptions.DEFAULTS, callback: MkdirCallback)

Create a directory, synchronously, specified by the provided path.

Link copied to clipboard
abstract fun mkdirSync(path: Value): String?
abstract fun mkdirSync(path: Path, options: MkdirOptions = MkdirOptions.DEFAULTS): String?
abstract fun mkdirSync(path: Value, options: Value?): String?

Create a directory, synchronously, specified by the provided path.

Link copied to clipboard
abstract fun writeFile(path: Value, data: Value, callback: Value)
abstract fun writeFile(path: Path, data: ByteArray, options: WriteFileOptions = WriteFileOptions.DEFAULTS, callback: WriteFileCallback)
abstract fun writeFile(path: Path, data: String, options: WriteFileOptions = WriteFileOptions.DEFAULTS, callback: WriteFileCallback)
abstract fun writeFile(path: Value, data: Value, options: Value?, callback: Value)

Writes the contents of a file at the specified path; provides the results or an error to the callback. This variant accepts a polyglot Value.

Link copied to clipboard
abstract fun writeFileSync(path: Value, data: Value)
abstract fun writeFileSync(path: Value, data: Value, options: Value?)

Writes the contents of a file at the specified path; provides the results or an error to the callback. This variant accepts a polyglot Value.

abstract fun writeFileSync(path: Path, data: ByteArray, options: WriteFileOptions = WriteFileOptions.DEFAULTS)

Writes the contents of a file at the specified path synchronously; throws if an error prevents the file from being written. This variant accepts a ByteArray.

abstract fun writeFileSync(path: Path, data: String, options: WriteFileOptions = WriteFileOptions.DEFAULTS)

Writes the contents of a file at the specified path synchronously; throws if an error prevents the file from being written. This variant accepts a String.