Re: Can't write to a subprocess - can't even compile

2017-03-17 Thread marksummerfield
Your reply shows almost exactly how I did it at first! However, I now realise that it failed to work because I hadn't imported streams, as your snippet shows, so thanks for that. The import means that it now builds and runs. It does crash though, so I'll have to look into that, but it is a star

Re: Can't write to a subprocess - can't even compile

2017-03-17 Thread Araq
You cannot use the handles with the file IO and expect things to work. osproc gives you `inputStream()` and `outputStream()` for a reason. import osproc, streams ... for i in 0..processes.high: var process = startProcess(config.subcommand,

Re: Can't write to a subprocess - can't even compile

2017-03-17 Thread marksummerfield
I can now get a variation to compile; but it doesn't actually work -- it crashes at runtime: Traceback (most recent call last) searchpdfscmd.nim(86)searchpdfscmd searchpdfscmd.nim(82)main searchpdfscmd.nim(50)doJobs osproc.nim(240) inputHandle

Re: Can't write to a subprocess - can't even compile

2017-03-17 Thread mashingan
Is `$` for Stream already implemented? cmiiw, I don't find the `$` for Stream in any lib.

Can't write to a subprocess - can't even compile

2017-03-17 Thread marksummerfield
I want to start a bunch of subprocesses and write some lines to each of them with some configuration data, then write filenames to them to process, and then tell them there's no more work to do. Then I want to gather any results they produce. The key function is this: proc doJobs(