- Subject: [jed-users] A couple of questions about the new_process() function
- From: Morten Bo Johansen <mbj@xxxxxxxxx>
- Date: Mon, 16 Dec 2024 21:06:31 +0100
Hi
Hopefully everybody is still alive ;)
If I use the new_process() function to run some command, I may
catch its exit status by appending a ".wait() to the command,
e.g.
variable obj = new_process([cmd], write=1).wait()
returns the following fields
pid
exited
exit_status
signal
coredump
stopped
continued
but not the object field, fp1
If I do
variable obj = new_process([cmd], write=1);
obj.wait();
I get the fp1 object field but not e.g. the exit_status field.
What wait method shall I specifiy in order to get both?
Second question: Can new_process() act as a replacement for the
open_process() function?
With the open_process() function, I can start a persistent
process and attach it to a buffer and then communicate with it
and capture the output without having to start and stop the
process every time. I would like to perhaps simplify and maybe
also "robustify" the flyspelling function in my aspell.sl
extension, but I can't seem to figure out how to do it. The
documentation for new_process() does not cite any examples for
using it as a replacement for open_process(). The command I use
with the open_process() function is (as an example)
variable pid = open_process ("aspell", "-d", "en", "-a", 3);
I may tie this process to a buffer and then send a word to it
and capture aspell's response as to whether the word was
misspelled or not.
Can I do something similar with new_process()?
Regards,
Morten
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2024 date index]
[2024 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]