mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 14:11:03 +00:00
Update pipe-ipc.js
This commit is contained in:
parent
01b5e7d46f
commit
f904b43777
|
@ -144,7 +144,6 @@ function PipeIPC() {
|
||||||
return new Date().getTime();
|
return new Date().getTime();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.setCharset = function(charset) {
|
this.setCharset = function(charset) {
|
||||||
this.charset = charset;
|
this.charset = charset;
|
||||||
};
|
};
|
||||||
|
@ -381,6 +380,7 @@ function PipeIPC() {
|
||||||
return s.length > 1 ? s.substring(1) : '';
|
return s.length > 1 ? s.substring(1) : '';
|
||||||
})(fh.ReadAll());
|
})(fh.ReadAll());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
//console.log(e.message);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -423,7 +423,7 @@ function PipeIPC() {
|
||||||
while (!isRead) {
|
while (!isRead) {
|
||||||
try {
|
try {
|
||||||
var ado = createADO();
|
var ado = createADO();
|
||||||
ado.CharSet = charset;
|
ado.Charset = charset;
|
||||||
ado.Open();
|
ado.Open();
|
||||||
ado.LoadFromFile(filename);
|
ado.LoadFromFile(filename);
|
||||||
text += ado.ReadText();
|
text += ado.ReadText();
|
||||||
|
@ -441,8 +441,9 @@ function PipeIPC() {
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loadFromFile = function(filename) {
|
this.loadFromFile = function(filename, charset) {
|
||||||
this.write(this.readTextFromFile(filename, this.charset), ForWriting);
|
charset = (typeof charset !== "undefined" ? this.charset : charset);
|
||||||
|
this.write(this.readTextFromFile(filename, charset), ForWriting);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.reload = function(charset) {
|
this.reload = function(charset) {
|
||||||
|
@ -476,7 +477,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
|
||||||
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
|
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
|
||||||
exports.adModeReadWrite = adModeReadWrite;
|
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.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = require;
|
exports.require = require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user