invoking options inside newLISP

Started by kanen, April 10, 2010, 04:14:54 PM

Previous topic - Next topic

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:


-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[/url] .

Lutz

#1
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.