summaryrefslogtreecommitdiff
path: root/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/fs-extra/lib/copy-sync/copy-file-sync.js
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/fs-extra/lib/copy-sync/copy-file-sync.js')
-rw-r--r--node_modules/fs-extra/lib/copy-sync/copy-file-sync.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js
deleted file mode 100644
index 102a6be..0000000
--- a/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-
-const BUF_LENGTH = 64 * 1024
-const _buff = require('../util/buffer')(BUF_LENGTH)
-
-function copyFileSync (srcFile, destFile, options) {
- const overwrite = options.overwrite
- const errorOnExist = options.errorOnExist
- const preserveTimestamps = options.preserveTimestamps
-
- if (fs.existsSync(destFile)) {
- if (overwrite) {
- fs.unlinkSync(destFile)
- } else if (errorOnExist) {
- throw new Error(`${destFile} already exists`)
- } else return
- }
-
- const fdr = fs.openSync(srcFile, 'r')
- const stat = fs.fstatSync(fdr)
- const fdw = fs.openSync(destFile, 'w', stat.mode)
- let bytesRead = 1
- let pos = 0
-
- while (bytesRead > 0) {
- bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
- fs.writeSync(fdw, _buff, 0, bytesRead)
- pos += bytesRead
- }
-
- if (preserveTimestamps) {
- fs.futimesSync(fdw, stat.atime, stat.mtime)
- }
-
- fs.closeSync(fdr)
- fs.closeSync(fdw)
-}
-
-module.exports = copyFileSync