summaryrefslogtreecommitdiff
path: root/tex/context/base/l-os.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-12-28 20:15:04 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-12-28 20:15:04 +0100
commitd446579377e40332a41f3c61b087b683a4a9b30c (patch)
treeec04b76dea309ff2b33af3b5f31c08a99d9ffb42 /tex/context/base/l-os.lua
parent69d17e62dd57cce4d59d020319edf1c5121f4319 (diff)
downloadcontext-d446579377e40332a41f3c61b087b683a4a9b30c.tar.gz
2014-12-28 19:53:00
Diffstat (limited to 'tex/context/base/l-os.lua')
-rw-r--r--tex/context/base/l-os.lua14
1 files changed, 4 insertions, 10 deletions
diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua
index 1dff79cd3..f44b31662 100644
--- a/tex/context/base/l-os.lua
+++ b/tex/context/base/l-os.lua
@@ -25,8 +25,6 @@ if not modules then modules = { } end modules ['l-os'] = {
-- os.sleep() => socket.sleep()
-- math.randomseed(tonumber(string.sub(string.reverse(tostring(math.floor(socket.gettime()*10000))),1,6)))
--- maybe build io.flush in os.execute
-
local os = os
local date, time = os.date, os.time
local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
@@ -118,15 +116,11 @@ end
-- end of environment hack
-local execute, spawn, exec, iopopen, ioflush = os.execute, os.spawn or os.execute, os.exec or os.execute, io.popen, io.flush
-
-function os.execute(...) ioflush() return execute(...) end
-function os.spawn (...) ioflush() return spawn (...) end
-function os.exec (...) ioflush() return exec (...) end
-function io.popen (...) ioflush() return iopopen(...) end
+local execute = os.execute
+local iopopen = io.popen
function os.resultof(command)
- local handle = io.popen(command,"r")
+ local handle = iopopen(command,"r") -- already has flush
if handle then
local result = handle:read("*all") or ""
handle:close()
@@ -160,7 +154,7 @@ local launchers = {
}
function os.launch(str)
- os.execute(format(launchers[os.name] or launchers.unix,str))
+ execute(format(launchers[os.name] or launchers.unix,str))
end
if not os.times then -- ?