gopher-lua icon indicating copy to clipboard operation
gopher-lua copied to clipboard

Fix the popen with "w" by closing the writer (otherwise wait never terminates)

Open scr-oath opened this issue 3 years ago • 1 comments
trafficstars

Changes proposed in this pull request:

  • When closing a lFileProcess close the writer before calling Wait
  • Normalize the stdout closing to also use casting to .(io.Closer)
  • Move the close of stdout after the Wait - data could still be written before the process finishes.
  • Add a test for read and write

scr-oath avatar Jul 31 '22 22:07 scr-oath

@yuin any chance you could merge this fix to the close method so that processes that are opened to be sent information (on their stdin) can be awaited too?

scr-oath avatar Nov 29 '22 17:11 scr-oath