diff options
author | Karl Berry <karl@freefriends.org> | 2015-12-02 22:25:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-12-02 22:25:24 +0000 |
commit | 8a154ca7d78ee39d443c3f43d9cb86ff1d71b411 (patch) | |
tree | aece0f86dda1a199e831661af24593dc4184b1e9 /Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua | |
parent | cd10cbba5784b911a3028369ffaa9e87e9a746aa (diff) |
lualibs (2dec15)
git-svn-id: svn://tug.org/texlive/trunk@38998 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua index 1dff79cd3f3..0a86ea6d697 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-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 -- ? @@ -355,6 +349,8 @@ else end +os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf + function resolvers.bits(t,k) local bits = find(os.platform,"64",1,true) and 64 or 32 os.bits = bits |