* Copies a file synchronously. * @param {string} src Source path * @param {string} dest Destination path * @param {number} [mode] Copy mode flags
(src, dest, mode)
| 404 | * @param {number} [mode] Copy mode flags |
| 405 | */ |
| 406 | copyFileSync(src, dest, mode) { |
| 407 | if (this.readonly) { |
| 408 | throw createEROFS('copyfile', dest); |
| 409 | } |
| 410 | if ((mode & COPYFILE_EXCL) !== 0) { |
| 411 | if (this.existsSync(dest)) { |
| 412 | throw createEEXIST('copyfile', dest); |
| 413 | } |
| 414 | } |
| 415 | const content = this.readFileSync(src); |
| 416 | this.writeFileSync(dest, content); |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Gets the real path by resolving symlinks. |
no test coverage detected