Communicating With NewLISP

Started by Sunburned Surveyor, May 08, 2006, 12:59:14 PM

Previous topic - Next topic

Sunburned Surveyor

I'm back. :]



I've done some reading on the "open", "exec", and "pipe" commands in the NewLISP manual and I'm still a little confused about the best way to approach a particular problem.



I'm trying to set up communication via text messages between a NewLISP application and an application that doesn't support pipes. (Namely AutoLISP...) However, I can write to text file from the other application.



I think I can write my message for the NewLISP application into a text file and use a combination of the "pipe", "exec" and "open" functions in my NewLISP application to incrementally read that text from the same file.



Is this possible, and if so, how might I use the three newLISP functions to do so?



Thanks for the help.



The Sunburned Surveyor

Lutz

#1
Use 'exec' for starting another application and capture it's outpout or feeding it input. Use 'process' together with 'pipe' if you can communicate with the other application via pipes, i.e. it's stdio i/o redirected through pipes.  'process' is not blocking and returns right away, leaving the started application running. Use '!' for starting another application in a blocking way.



Quick communications via files is possible using 'read-file', 'write-file' and 'append-file'. All three allow reading/writing files without 'open' and file handles.



All the functions mentioned here have ample documentation in the manual.



Lutz

Sunburned Surveyor

#2
Thanks for the quick response Lutz.



I have looked over the manual, but still wasn't clear on a couple things. I will spend some more time thinking about my problem. In a few days I'll try to post some more details if I can't get it working.



Thanks for your explanation and help.



The Sunburned Surveyor