From owner-help-octave at bevo dot che dot wisc dot edu Wed Feb 5 15:28:37 1997 Subject: subprocesses From: "John W. Eaton" To: James Walter Taylor Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 5 Feb 1997 15:27:22 -0600 On 5-Feb-1997, James Walter Taylor wrote: | I'm using octave to drive the testing of a pattern recognition | program. An octave script generates a pattern, stores it in a | file and starts an external process which processes the data. | | i.e. a loop around a construct like: | | --- | V = blah(); | fdx=fopen(tmpFile, 'w'); | fprintf(fdx, '%d\n', V); | fclose(fdx); | | [result,s] = system(['/home/james/newthing <' tmpFile ]); | | --- | millions of times. Well after only a few 10s of thousands of times | I see errors like: | | error: unable to start subprocess for `/home/james/newthing ls | error: couldn't start process for ls! | error: evaluating expression near line 27, column 1 | --- This sounds like a bug. It might be a bug in Octave, but I can't be sure. What version of Octave are you using? What kind of system are you using? What does the external program do? I took a guess, and tried running for i = 1:100000 fn = tmpnam (); fd = fopen (fn, 'w'); fprintf (fd, '%d\n', i); fclose (fd); [result, s] = system (['cat ', fn]); printf (result); fflush (stdout); unlink (fn); endfor but it seems to work correctly. Please send bug reports to bug-octave at bevo dot che dot wisc dot edu, and please include enough information so that I might be able to fix the problem. The Bugs chapter in the Octave manual has a list of items that should be in every bug report, and includes tips for writing bug reports that will help to ensure that the bug is actually fixed. Thanks, jwe