From 6632b6a8c3815670fef4257c136d461583052120 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 29 Dec 2014 23:41:38 +0100 Subject: sync with Context as of 2014-12-29 --- lualibs-os.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lualibs-os.lua') diff --git a/lualibs-os.lua b/lualibs-os.lua index 1dff79c..f44b316 100644 --- a/lualibs-os.lua +++ b/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 -- ? -- cgit v1.2.3 From a79c845dba381f543d09526f77dcf2b4687b73a7 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 4 May 2015 23:10:29 +0200 Subject: sync with Context as of 2015-05-04 --- lualibs-os.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lualibs-os.lua') diff --git a/lualibs-os.lua b/lualibs-os.lua index f44b316..0a86ea6 100644 --- a/lualibs-os.lua +++ b/lualibs-os.lua @@ -349,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 -- cgit v1.2.3