Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug or unimplemented functionality in sys.fexecute() #10

Closed
CCorfield opened this issue Aug 15, 2016 · 2 comments
Closed

Possible bug or unimplemented functionality in sys.fexecute() #10

CCorfield opened this issue Aug 15, 2016 · 2 comments

Comments

@CCorfield
Copy link

The parameter "readwhat" is not used, but is referenced from the parallel module (see the code for forking).

Proposed fix:

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)
return s
end

@soumith
Copy link
Member

soumith commented Aug 24, 2016

fixed via 6de204c
Thank you!

@soumith soumith closed this as completed Aug 24, 2016
@CCorfield
Copy link
Author

You are very welcome and "Thank You" for all the great work have been doing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants