Re: How to simple exit in CGI?
Jean Louis <[email protected]> Wed, 29 Mar 2017 01:21:23 +0300
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
Thank you. On Tue, Mar 28, 2017 at 11:51:06PM +0200, Pascal Bourguignon wrote: > Also, you’ve been told to use *stars* around the name of special > variables defined with defvar or defparameter. You really need to > do it! Those are snippets from before, now is changing. > > (defun check-the (file) > > (let ((file (format nil "~a.lisp" file))) > > (file-stat-mtime (file-stat file)))) > > > > (defparameter check (check-the file)) > > > > (defun do-compile (file) ;; (setf file "order") > > (cd "/home/data1/protected/public_html/") > > (let* ((original (format nil "~a.lisp" file)) > > (executable (format nil "~a.cgi" file)) > > (command (format nil "lisp -i ~a -x "(saveinitmem \"~a\" :executable t :init-function 'main :quiet t :norc t)"" original executable))) > > (unless (equalp check (check-the file)) > > (print command) > > (shell command) > > (set-file-stat executable :mode #O0755) > > (setf check (check-the file)))) > > (sleep .3)) > > Here, you’re not using clisp, but CMU CL (lisp). > (Each character is important, with computers). I don't know what you wish to say with that one. I am using CLISP at all times. CMU CL does not compile on 64 bit architectures Thank you, I read all tutorials. > > (format t "Content-type: text/plain~2%")) > > > > (defun main () > > (let ((url "http://localhost") > > (query (or (getenv "QUERY_STRING") > > (POST-collect)))) > > ;; (format t "Status: 302 Found~%Location: ~a~%~%" url) > > (headers) > > (princ "Hello there") > > ;; (finish-output) > > I would advise you to keep calls to finish-output (and always use it > when doing interactive I/O). OK > Your code is wrong. My code is correct: I proved it to you by > showing you how it worked correctly in two different ways. I have tried those files you have sent to me. I did not notice they were attached until I did. So I tried. I get again the problem, of little different nature. You can see on this screenshot: https://rcdrun.com/files/tmp/2017-03-29-01:16:51.jpg *** - OS-ERROR(EFAULT): Bad address Break 1 [1]> > > and if I make the same in CLISP: > > > > (defun main () > > (exit)) > > > > and save as memory image, the wget is not exiting. Basically CLISP is > > not exiting. > > You’re lying. Maybe you are joking. Anyway, I am not lying. I am trying to find out why is it, so that I can avoid it. When you run that same jean-cgi script, as executable image and CGI on your side, you don't get any error like me? Jean ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list