copyFile

abstract fun copyFile(src: Path, dest: Path, mode: Int? = null): JsPromise<Value>

Method: fs.copyFile

Asynchronously copies a file using host-side types.

Copies the contents at the provided src path to the provided dest path; the returned promise is resolved once the copy operation completes.

Return

Upon success, fulfills with undefined; otherwise, rejects with an error.

Parameters

src

The source path to copy from.

dest

The destination path to copy to.

mode

Copy mode constant to apply.


abstract fun copyFile(src: Value, dest: Value): JsPromise<Value>

Method: fs.copyFile

Asynchronously copies a file.

Copies the contents at the provided src path to the provided dest path; the returned promise is resolved once the copy operation completes.

Return

Upon success, fulfills with undefined; otherwise, rejects with an error.

Parameters

src

The source path to copy from.

dest

The destination path to copy to.


abstract fun copyFile(src: Value, dest: Value, mode: Int): JsPromise<Value>

Method: fs.copyFile

Asynchronously copies a file.

Copies the contents at the provided src path to the provided dest path; the returned promise is resolved once the copy operation completes.

Return

Upon success, fulfills with undefined; otherwise, rejects with an error.

Parameters

src

The source path to copy from.

dest

The destination path to copy to.

mode

The mode to use for the copy operation.