> < ^ Date: Sun, 13 Feb 2000 15:39:25 -0600
< ^ From: Nathan Dunfield <nathand@abel.math.harvard.edu >
> ^ Subject: Problem with Process, DirectoryTemporary, and StringStreams

Dear Gap Forum,

Problem: When DirectoryTemporary is called, more than 5000 calls to
Process with the output stream being a text stream results in an
error. (The error always occurs on exactly the 5000th call).

Version/Platform: GAP4, Version: 4r1 of 26-Jul-1999, on linux and solaris.

Example Code:

NumTimes := 0;
tmpfile := DirectoryTemporary();
Command := "/bin/date";

Test := function()
   local a, str;
   NumTimes := NumTimes + 1;
   str := ""; a := OutputTextString(str,false);
   Process( DirectoryCurrent(), Command, InputTextNone(), a, []);
   CloseStream(a);
end;

for i in [1..10000] do
    Test();
od;

Running this results in:

mafalda(101) gap < test.gap
GAP4, Version: 4r1 of 26-Jul-1999, i686-pc-linux-gnu-gcc
gap> 0
gap> dir("/tmp/filezqEcsX.0001/")
gap> gap> gap> "/bin/date"
gap> gap> > > > > > > function( ) ... end
gap> gap> > > > List Element: <list> must be a list (not a boolean) at
return ExecuteProcess( dir, prg, input![1], output![1], args );
EXECUTE_PROCESS_FILE_STREAM( dir, prg, input, new_output, args ) called from
Process( DirectoryCurrent( ), Command, InputTextNone( ), a, [ ]
); called from
Test( ); called from
<function>( <arguments> ) called from read-eval-loop
brk> NumTimes;
5000

Removing the call to DirectoryTemporary() causes the code to work
fine. Replacing the StringStream with OutputTextNone() also causes
the code to work fine.

-Nathan

Miles-Receive-Header: reply


> < [top]