exec:// streams -- how to wait until the process is done?

38 views
Skip to first unread message

Jason S

unread,
Aug 2, 2012, 10:28:28 AM8/2/12
to js...@googlegroups.com
canRead, canWrite, eof don't seem to correlate with when a process is done.... If I run an external program that takes a while (like "svn co ...") how do I know when it is done?

Shanti Rao

unread,
Aug 2, 2012, 11:52:41 AM8/2/12
to js...@googlegroups.com
Jason,

Here's what's supposed to happen:
  • Stream.canWrite is true while the process is running
  • Stream.canRead is true when the fifo is non-empty
  • Stream.eof is true when the process is done and the fifo is empty
  • Stream.readFile() waits until the process ends and returns all remaining output.

Getting this to work correctly on all OSs has been a challenge. Which versions of JSDB and OSX are you running?

Shanti

Jason S

unread,
Aug 2, 2012, 12:41:25 PM8/2/12
to js...@googlegroups.com
False alarm -- Stream.eof seems to work correctly after all, I had a bad svn repository connection while using svn via jsdb's stream-exec and I just wasn't getting the results I expected.

Jason S

unread,
Aug 2, 2012, 12:42:19 PM8/2/12
to js...@googlegroups.com
ooh -- looks like readFile() is an even better choice, if I don't need to read process output as it is being streamed.
Reply all
Reply to author
Forward
0 new messages