[Gambas-devel] About process management

Daniel Campos danielcampos at ...45...
Sun Mar 7 11:28:02 CET 2004


Hi Benoît (and company):

When executing a program using EXEC, I always find a problem:

I can not recover all stdout output from the process, as usually the
process is closed by gambas before all data has been read from the
gambas input pipe. Try, for example "Proceso1.tar.gz", this little
program makes 'ls -l' on the home directory (change it for any other
with a lot of files, if you have few files at home directory). 

You will see in the textarea that you receive just a fragment from
the ls output, all the rest is lost (the final part). 

 I've been looking at the gbx_c_process.c file, and the final
part of the output is beeing 'abandoned'. I've added a buffer
in the process structure at "gbx_c_process.h" file, and I manage
it in the "gbx_c_process.c" (my 'hackings' are marked between 
"/*<DCF*/ and /*DCF>*/ symbols), and I've seen I can recover
the final part of the output and print it in the stdout, and buffer it
into the process structure. (try "Proceso1" example using these files I
provide)

 My idea was to keep that data in the buffer, and send 'Read' events
to let the user retrieve the rest of the information, extracting data
from the buffer instead of the pipe when the process is already dead.

 However I do not understand very well the process stream, so, at this
moment I just send you that patched files, I suppose you can correct
this "read bug" better than me :-)

 If this bug is corrected, process management will be more useful for
a lot of people, allowing to perform a lot of tasks using unix commands!

Regards,

Daniel Campos
  


-- 
Daniel Campos <danielcampos at ...45...>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Proceso1-0.0.tar.gz
Type: application/x-compressed-tar
Size: 1201 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040307/fd2ba2a0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbx_c_process.h
Type: text/x-c-header
Size: 1706 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040307/fd2ba2a0/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbx_c_process.c
Type: text/x-c
Size: 12868 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20040307/fd2ba2a0/attachment-0002.bin>


More information about the Devel mailing list