mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 08:55:14 +00:00
Update pipe-ipc.js
This commit is contained in:
parent
c4ccdaf1aa
commit
6b55a2d0de
|
@ -98,7 +98,7 @@ function openTextFile(filename, iomode) {
|
|||
}
|
||||
|
||||
function checkFileExists(filename) {
|
||||
return createFSO().FileExists(filename);
|
||||
return createFSO().FileExists(filename);;
|
||||
}
|
||||
|
||||
function deleteFile(filename) {
|
||||
|
@ -156,6 +156,7 @@ function PipeIPC() {
|
|||
this.path = this.path.replace(":pipename", pipename);
|
||||
//this.openWriter();
|
||||
this.openReader();
|
||||
//console.info("Opened pipe:", pipename);
|
||||
if (typeof callback === "function") {
|
||||
callback(this, this.reader, this.writer);
|
||||
}
|
||||
|
@ -365,7 +366,9 @@ function PipeIPC() {
|
|||
};
|
||||
|
||||
this._read = function() {
|
||||
return this.reader.ReadAll();
|
||||
return (function(s) {
|
||||
return s.length > 1 ? s.substring(1) : '';
|
||||
})(this.reader.ReadAll());
|
||||
};
|
||||
|
||||
this.read = function() {
|
||||
|
@ -413,6 +416,7 @@ function PipeIPC() {
|
|||
ado.Close();
|
||||
isRead = true;
|
||||
} catch (e) {
|
||||
//console.log(e.message);
|
||||
isRead = false;
|
||||
}
|
||||
}
|
||||
|
@ -423,8 +427,8 @@ function PipeIPC() {
|
|||
return text;
|
||||
};
|
||||
|
||||
this.loadFromFile = function(filename, charset) {
|
||||
this.write(this.readTextFromFile(filename, charset), ForWriting);
|
||||
this.loadFromFile = function(filename) {
|
||||
this.write(this.readTextFromFile(filename, this.charset), ForWriting);
|
||||
};
|
||||
|
||||
this.reload = function(charset) {
|
||||
|
@ -458,7 +462,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
|
|||
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
|
||||
exports.adModeReadWrite = adModeReadWrite;
|
||||
|
||||
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.13";
|
||||
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.14";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user