Update file.js

This commit is contained in:
Namhyeon Go 2025-08-05 17:45:46 +09:00 committed by GitHub
parent 68a57f15fb
commit 444b80e3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,12 +61,13 @@ function writeFile(path, content, charset) {
} }
function writeBinaryFile(path, data) { function writeBinaryFile(path, data) {
var binaryStream = CreateObject("ADODB.Stream"); return UseObject("ADODB.Stream", function(stream) {
binaryStream.Type = PipeIPC.adTypeBinary; stream.Type = PipeIPC.adTypeBinary;
binaryStream.Open(); stream.Open();
binaryStream.Write(data); stream.Write(data);
binaryStream.SaveToFile(path, adSaveCreateOverWrite); stream.SaveToFile(path, adSaveCreateOverWrite);
binaryStream.Close(); stream.Close();
});
} }
function moveFile(fromPath, toPath) { function moveFile(fromPath, toPath) {
@ -189,7 +190,7 @@ exports.loadEnvFromArgs = loadEnvFromArgs;
exports.CdoCharset = PipeIPC.CdoCharset; exports.CdoCharset = PipeIPC.CdoCharset;
exports.VERSIONINFO = "File IO Library (file.js) version 0.2.14"; exports.VERSIONINFO = "File IO Library (file.js) version 0.2.15";
exports.AUTHOR = "gnh1201@catswords.re.kr"; exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global; exports.global = global;
exports.require = global.require; exports.require = global.require;