diff --git a/lib/shell.js b/lib/shell.js index 6ff3027..3b2301b 100644 --- a/lib/shell.js +++ b/lib/shell.js @@ -2,6 +2,9 @@ // Shell API //////////////////////////////////////////////////////////////////////// var FILE = require("lib/file"); +var RAND = require("lib/rand"); + +var SEED = RAND.getSeed(); var ShellObject = function() { this.interface = null; @@ -68,9 +71,8 @@ var ShellObject = function() { this.exec = function(cmd, stdOutPath, stdErrPath) { var stdout, stderr; - var seed = parseInt(Math.random() * 10000); - var stdOutPath = (typeof(stdOutPath) === "undefined" ? "tmp\\stdout_" + seed + ".txt" : stdOutPath); - var stdErrPath = (typeof(stdErrPath) === "undefined" ? "tmp\\stderr_" + seed + ".txt" : stdErrPath); + var stdOutPath = (typeof(stdOutPath) === "undefined" ? "tmp\\stdout_" + SEED + ".txt" : stdOutPath); + var stdErrPath = (typeof(stdErrPath) === "undefined" ? "tmp\\stderr_" + SEED + ".txt" : stdErrPath); var c = "%comspec% /c (" + this.build(cmd) + ") 1> " + stdOutPath; //c += " 2>&1"; @@ -192,6 +194,6 @@ exports.getPathOfMyDocuments = function() { return (new ShellObject()).getPathOfMyDocuments(); }; -exports.VERSIONINFO = "Shell interface (shell.js) version 0.2"; +exports.VERSIONINFO = "Shell interface (shell.js) version 0.3"; exports.global = global; exports.require = global.require;