invoking options inside newLISP

Q&A's, tips, howto's
Locked
kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

invoking options inside newLISP

Post by kanen »

I would like to be able to programmaticly change certain options, without passing them on the command-line. Am I forced to spawn a new version of newLISP to do this?

For example;

I want to check the amount of memory available for my program, then invoke:

Code: Select all

-s <stacksize>
-m <max-mem-megabyte>
I am also assuming, for a web server, I should simply fork a new instance of newLISP with -http <port> if I want to invoke an http server from within my code?
. Kanen Flowers http://kanen.me .

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: invoking options inside newLISP

Post by Lutz »

Yes, stacksize and max-mem-size can only be changed from the command-line.

NewLISP has a very quick startup time, so I would use the non-blocking 'process' to start a new newLISP-server instance. The 'process' function uses C fork() and execve() internally and also does all the I/O pipe setup necessary. This is how the qa-net test script in newlisp-x.x.x/qa-specific-tests/ was written. Process also returns a a pid, you can use to 'destroy' the process. You also can do your own I/O and error -pipe setup for 'process' if necessary.

Locked