Update pipe-ipc.js

This commit is contained in:
Namhyeon Go 2023-09-21 21:44:26 +09:00 committed by GitHub
parent 01b5e7d46f
commit f904b43777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,6 @@ function PipeIPC() {
this.getCurrentTime = function() {
return new Date().getTime();
};
this.setCharset = function(charset) {
this.charset = charset;
@ -381,6 +380,7 @@ function PipeIPC() {
return s.length > 1 ? s.substring(1) : '';
})(fh.ReadAll());
} catch (e) {
//console.log(e.message);
return '';
}
};
@ -423,7 +423,7 @@ function PipeIPC() {
while (!isRead) {
try {
var ado = createADO();
ado.CharSet = charset;
ado.Charset = charset;
ado.Open();
ado.LoadFromFile(filename);
text += ado.ReadText();
@ -441,8 +441,9 @@ function PipeIPC() {
return text;
};
this.loadFromFile = function(filename) {
this.write(this.readTextFromFile(filename, this.charset), ForWriting);
this.loadFromFile = function(filename, charset) {
charset = (typeof charset !== "undefined" ? this.charset : charset);
this.write(this.readTextFromFile(filename, charset), ForWriting);
};
this.reload = function(charset) {
@ -476,7 +477,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
exports.adModeReadWrite = adModeReadWrite;
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.15";
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.16";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = require;