Update pipe-ipc.js

This commit is contained in:
Namhyeon Go 2023-09-19 19:28:04 +09:00 committed by GitHub
parent d05d4deb03
commit a035304803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,6 +145,15 @@ function PipeIPC() {
this.startRecorder = function(filename, iomode) {
this.savefile = filename;
this.tmpfile = this.savefile + ".tmp";
// read a text from save file
var isExistsSaveFile = createFSO().FileExists(this.savefile);
if (isExistsSaveFile) {
var handler = createFSO().OpenTextFile(this.tmpfile, ForWriting, true, TristateTrue);
handler.Write(this.readTextFromFile(filename));
handler.Close();
}
this.openRecorder(iomode);
};
@ -364,7 +373,7 @@ function PipeIPC() {
this.loadFromFile = function(filename) {
return this.readTextFromFile(filename);
this.write(this.readTextFromFile(filename));
};
}
@ -392,7 +401,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
exports.adModeReadWrite = adModeReadWrite;
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.6";
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.8";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = require;