kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Improve buffer allocation for copying files in utils/filesystem.js
rodzic
d2c4920ba4
commit
2abc5dee78
|
@ -52,9 +52,13 @@ exports.copyDirectory = function(srcPath,dstPath) {
|
|||
Copy a file
|
||||
*/
|
||||
var FILE_BUFFER_LENGTH = 64 * 1024,
|
||||
fileBuffer = $tw.node && new Buffer(FILE_BUFFER_LENGTH);
|
||||
fileBuffer;
|
||||
|
||||
exports.copyFile = function(srcPath,dstPath) {
|
||||
// Create buffer if required
|
||||
if(!fileBuffer) {
|
||||
fileBuffer = new Buffer(FILE_BUFFER_LENGTH);
|
||||
}
|
||||
// Create any directories in the destination
|
||||
$tw.utils.createDirectory(path.dirname(dstPath));
|
||||
// Copy the file
|
||||
|
|
Ładowanie…
Reference in New Issue