mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
Update pipe-ipc.js
This commit is contained in:
parent
30f16cf3e8
commit
3999bcc171
|
@ -69,16 +69,18 @@ function createADO() {
|
|||
return CreateObject("ADODB.Stream");
|
||||
}
|
||||
|
||||
function SetPositionADO(ado, position) {
|
||||
var newAdo = createADO();
|
||||
newAdo.Type = adTypeBinary;
|
||||
newAdo.Mode = adModeReadWrite;
|
||||
newAdo.Open();
|
||||
ado.Position = position;
|
||||
ado.CopyTo(newAdo);
|
||||
ado.Flush();
|
||||
ado.Close();
|
||||
return newAdo;
|
||||
function AdoConvertToStream(ado, position) {
|
||||
position = (position !== "undefined" ? position : 0);
|
||||
|
||||
var newAdo = createADO();
|
||||
newAdo.Type = adTypeBinary;
|
||||
newAdo.Mode = adModeReadWrite;
|
||||
newAdo.Open();
|
||||
ado.Position = position;
|
||||
ado.CopyTo(newAdo);
|
||||
ado.Flush();
|
||||
ado.Close();
|
||||
return newAdo;
|
||||
}
|
||||
|
||||
function PipeIPC() {
|
||||
|
@ -167,7 +169,7 @@ function PipeIPC() {
|
|||
}
|
||||
|
||||
// with iomode (default: ForAppending)
|
||||
var iomode = (iomode !== "undefined" ? ForAppending : iomode);
|
||||
iomode = (iomode !== "undefined" ? ForAppending : iomode);
|
||||
this.openRecorder(iomode);
|
||||
};
|
||||
|
||||
|
@ -197,7 +199,7 @@ function PipeIPC() {
|
|||
|
||||
this.write = function(message, iomode) {
|
||||
// with iomode (default: ForAppending)
|
||||
var iomode = (iomode !== "undefined" ? ForAppending : iomode);
|
||||
iomode = (iomode !== "undefined" ? ForAppending : iomode);
|
||||
|
||||
if (this.savefile != null) {
|
||||
this.record(message);
|
||||
|
@ -273,7 +275,7 @@ function PipeIPC() {
|
|||
ado.Charset = charset;
|
||||
ado.Open();
|
||||
ado.WriteText(str);
|
||||
ado = SetPositionADO(ado, 3);
|
||||
ado = AdoConvertToStream(ado, 3);
|
||||
ado.SaveToFile(dst, adSaveCreateOverWrite);
|
||||
ado.Close();
|
||||
|
||||
|
@ -405,7 +407,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
|
|||
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
|
||||
exports.adModeReadWrite = adModeReadWrite;
|
||||
|
||||
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.9";
|
||||
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.10";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user