diff options
-rw-r--r-- | src/loadlib.js | 2 | ||||
-rw-r--r-- | src/loslib.js | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/loadlib.js b/src/loadlib.js index bb7792a..0be1742 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -133,7 +133,7 @@ if (typeof process !== "undefined") { // Only with Node readable = function(filename) { try { - let fd = fs.openSync(Uint8Array.from(filename), 'r'); + let fd = fs.openSync(filename, 'r'); fs.closeSync(fd); } catch (e) { return false; diff --git a/src/loslib.js b/src/loslib.js index 83da409..ecd42f1 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -208,7 +208,6 @@ if (typeof process === "undefined") { syslib.remove = function(L) { let filename = lauxlib.luaL_checkstring(L, 1); try { - filename = Uint8Array.from(filename); if (fs.lstatSync(filename).isDirectory()) { fs.rmdirSync(filename); } else { @@ -224,8 +223,6 @@ if (typeof process === "undefined") { let fromname = lauxlib.luaL_checkstring(L, 1); let toname = lauxlib.luaL_checkstring(L, 2); try { - fromname = Uint8Array.from(fromname); - toname = Uint8Array.from(toname); fs.renameSync(fromname, toname); } catch (e) { return lauxlib.luaL_fileresult(L, false, false, e); @@ -246,7 +243,7 @@ if (typeof process === "undefined") { if (cmd !== null) { try { child_process.execSync( - Uint8Array.from(cmd), + cmd, { stdio: [process.stdin, process.stdout, process.stderr] } |