diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-08-25 02:14:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-25 02:14:05 +0300 |
commit | 6de204cc2254234f8c1caa418ac36d75ee3b0488 (patch) | |
tree | a47d1da50b151d0558be9a32410133a23ba84b54 | |
parent | 8d2b8facd22e55d66ac71cb778f451694e7611fa (diff) |
fixing readwhat option
-rw-r--r-- | init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -48,11 +48,12 @@ sys.execute = execute -- this call is typically more robust than the one above (on some systems) -------------------------------------------------------------------------------- function sys.fexecute(cmd, readwhat) + readwhat = readwhat or '*all' local tmpfile = os.tmpname() local cmd = cmd .. ' 1>'.. tmpfile..' 2>' .. tmpfile os.execute(cmd) local file = _G.assert(io.open(tmpfile)) - local s = file:read('*all') + local s= file:read(readwhat) file:close() s = s:gsub('^%s*',''):gsub('%s*$','') os.execute('rm ' .. tmpfile) |