Watton, John D. | 7 Jul 19:57 2006
Picon

Run-shell-command problem on Windows

I have a problem using run-shell-command on Windows if I use the full
path to the executable. 

The following, (excl:run-shell-command "C:\\Program Files\\Internet
Explorer\\iexplore.exe" :wait nil) will run properly. If I make a copy
of iexplore and I put it into a subdirectory of  "C:\\Documents and
Settings" then I have a problem. For example,  (excl:run-shell-command
"C:\\Documents and Settings\\wattojd\\My Documents\\bin\\iexplore.exe"
:wait nil) will get the error: "No such file or directory". If I put a
copy of iexplore in other directories it works fine. I think the spaces
in "Documents and Settings" is causing confusion.

Is there a way anyone knows around this problem? It became an issue for
me because I have a tendency to put stuff in a subdirectory of
"C:\\Documents and Settings".

Many Thanks
John Watton

Dave Mihalik | 13 Jul 02:39 2006
Picon

Console Hello World howto

Can someone show me how to create a console application that prints hello world to the console on Microsoft Windows?

 

I am not interested in creating a Windows application but rather a console application on the Windows platform.

 

I have created a project called test1 and added a file called test1.cl with the following contents:

 

(defun test1()

 

(let ((mystring1 "")))

(setf mystring1 "Hello World")

(print mystring1)

 

)

 

I compiled the program into an executable and when I execute it, the following appears in the debug console:

 

International Allegro CL Free Express Edition

8.0 [Windows] (Jul 12, 2006 20:34)

Copyright (C) 1985-2006, Franz Inc., Oakland, CA, USA.  All Rights Reserved.

 

This development copy of Allegro CL is licensed to:

   Trial User

 

;;---

;; The compiler is not loaded into this lisp.

; Foreign loading ole32.dll.

; Foreign loading advapi32.dll.

; Foreign loading oleaut32.dll.

; Foreign loading riched32.dll.

Error: The project has no main form to run.  Either use File | New Form

       to add a form to the project, or give the project a custom

       on-initialization function.

 

Restart actions (select using :continue):

 0: Abort entirely from this (lisp) process.

 

[changing package from "COMMON-LISP-USER" to "COMMON-GRAPHICS-USER"]

[Current process: Initial Lisp Listener]

[1] CG-USER(1):

 

 

At this point, I am trying to set the on-initialization function.  I set the Init Fn: field to test1 on the Options tab of the Project Manager which when saved gets set to CG-USER::TEST1. 

 

I compiled the executable file again and when run, the following appears in the debug console:

 

This development copy of Allegro CL is licensed to:

   Trial User

 

;;---

;; The compiler is not loaded into this lisp.

; Foreign loading ole32.dll.

; Foreign loading advapi32.dll.

; Foreign loading oleaut32.dll.

; Foreign loading riched32.dll.

Error: attempt to call `TEST1' which is an undefined function.

  [condition type: UNDEFINED-FUNCTION]

 

Restart actions (select using :continue):

 0: Try calling TEST1 again.

 1: Try calling COMMON-LISP-USER::TEST1 instead.

 2: Return a value instead of calling TEST1.

 3: Try calling a function other than TEST1.

 4: Setf the symbol-function of TEST1 and call it again.

 5: Abort entirely from this (lisp) process.

 

[changing package from "COMMON-LISP-USER" to "COMMON-GRAPHICS-USER"]

[Current process: Initial Lisp Listener]

[1] CG-USER(1):

 

I am not sure what to do at this point.  Any help is appreciated.

 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/386 - Release Date: 7/12/2006

David Margolies | 13 Jul 22:33 2006
Picon

Re: Console Hello World how to

Dave Mihalik asked about a no-window application created by Allegro
CL. He is using the project system. He ahs a fuction in test1.cl

(defun test1()
  (let ((mystring1 "")))
  (setf mystring1 "Hello World")
  (print mystring1)
 ) 

which he make the on-initialization function of the project, but
when the app starts, he gets the error:

Error: attempt to call `TEST1' which is an undefined function.
  [condition type: UNDEFINED-FUNCTION]

I wrote him the following which I also am sending to this list.

The package problem would be solve by placing 

  (in-package :cg-user)

at the head of your test1.cl file.  (Without an in-package form, the
symbols are read in whatever package happens to be current when the
file is loaded.  That seems to be the cl-user package when the project
executable is made.  Because it is hard to know what package will be
current when things are done automatically.

Once you do that, the project will comile and run correctly, but you
will run into another difficulty testing it: the program will exit
when it completes and it iwll complete so fast that it is unlikely you
will see anything.

Change your function to this:

  (defun test1()
    (let ((mystring1 "")))
    (setf mystring1 "Hello World")
    (print mystring1)
    (sleep 100)
   )

and the console will be there for a while.  Also add this and correct
your LET form (which is doing nothing since you have closed it off:

  (defun test1()
    (console-control :show t)
    (let ((mystring1 ""))
      (setf mystring1 "Hello World")
      (print mystring1)
      (sleep 100))
   )

This will ensure the console is displayed.

But the program will end after 100 seconds.

The point is that your program is either doing something or it is
waiting for the user to do something.  If your program is doing
something, it ends when that something is done.  If your porgram is
waiting on the user, it has to ask for input in some fashion.  

If your app had windows (the main one specified by the project Main
Form), then that window would be displayed and the program would exit
when it is closed. But your program doesn't.  This will ask for user
input:

  (defun test1()
    (console-control :show t)
    (let ((mystring1 ""))
      (setf mystring1 "Hello World")
      (print mystring1)
      (loop (if (y-or-n-p "Stop now? ") (exit 0 :no-unwind t)))
   )

If you hit n, you are asked again. If you hit y, it exits.

David Margolies
Franz Inc.

Jacques RATTIER | 17 Jul 15:24 2006
Picon

for lisp code to read/write IPTC metadata on JPEG files

Hello,

I’m looking for lisp code to read/write IPTC metadata on JPEG files.

Can someone help me ?

Best regards

 

Jacques

jacques.rattier <at> wanadoo.fr

http://perso.orange.fr/orta/

 

Greger Lindell | 17 Jul 16:20 2006
Picon

RE: for lisp code to read/write IPTC metadata on JPEG files

Hello,

 

We have developed software for EXIF metadata, so that is a good start.

 

Regards,

 

Greger Lindell

Greger Lindell

Intan2

Director, PhD

 

 

 

 

 

Intanto
Av
Van Der Meerschen 92
1150 Brussels - Bruxelles
Belgium

   

Tel: +32 (0)2 742 25 12
GSM: +32 (0)497 50 51 95
cgl <at> inthan.be
www.intan2.be

 

 
 
 
 
 
 
 
 
 
 
 
-----Original Message-----
From: Jacques RATTIER [mailto:jacques.rattier <at> wanadoo.fr]
Sent: Monday, July 17, 2006 15:24
To: allegro-cl <at> cs.berkeley.edu
Subject: for lisp code to read/write IPTC metadata on JPEG files

Hello,

I’m looking for lisp code to read/write IPTC metadata on JPEG files.

Can someone help me ?

Best regards

 

Jacques

jacques.rattier <at> wanadoo.fr

http://perso.orange.fr/orta/

 

Pierpaolo BERNARDI | 22 Jul 20:17 2006
Picon
Picon

Re: Unexpected error


Hello,

apparently, even with the latest patch, prolog still fails at random times.

Below there's a source file and an interaction transcript.

(Express edition, updated today)

HTH

== bugr.cl ==

(defpackage provapro
   (:use :cl :prolog))

(in-package :provapro)

(<-- (fa-rete ?l ?r ?v)
      (append ?l1 ?l2 ?l)
      (not (== ?l1 ()))
      (not (== ?l2 ()))
      (fa-rete ?l1 ?r1 ?v1)
      (fa-rete ?l2 ?r2 ?v2)
      (or (and (= ?r (ser ?r1 ?r2))
	      (is ?v (+ ?v1 ?v2)))
	 (and (= ?r (par ?r1 ?r2))
	      (is ?v (/ (+ (/ ?v1) (/ ?v2)))))))
(<- (fa-rete (?q) ?q ?q))

(defun ohm (resistori &optional (val-min 1d300))
   (let ((rete-min))
     (prolog (lisp ?lista resistori)
             (and (fa-rete ?lista ?rete ?valore)
                  (lisp* (let ((val (abs (- ?valore pi))))
                           (when (< val val-min)
                             (setf val-min val
                                   rete-min ?rete))))))
     (values val-min rete-min)))

(defun test ()
   (time
    (let ((perm '(1 2 3 4 5 6 7 8 9 10)))
      (print perm)
      (multiple-value-bind (meglio rete) (ohm perm)
        (print meglio)
        (pprint rete)))))

== end of bugr.cl ==

Transcript:

CL-USER(1):
;;; Note: The emacs-mule external-format, used to transmit
;;;       international (non-ascii) characters for the emacs-lisp
;;;       interface, is not being loaded due to lack of heap space in
;;;       this Lisp session.
CL-USER(2): :cl ../prolog/bugr
;;; Compiling file ..\prolog\bugr.cl
; Autoloading for package "PROLOG":
; Fast loading c:\Program Files\acl80-express\code\PROLOG.002
;;; Writing fasl file ..\prolog\bugr.fasl
;;; Fasl write complete
; Fast loading
;    c:\Documents and Settings\pierpaolo\My Documents\prolog\bugr.fasl
CL-USER(3): (in-package :provapro)
#<The PROVAPRO package>
PROVAPRO(4): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,108 msec user, 78 msec system
; cpu time (gc)     767 msec user, 0 msec system
; cpu time (total)  8,875 msec user, 78 msec system
; real time  15,438 msec
; space allocation:
;  67,285,961 cons cells, 542,541,384 other bytes, 4,152 static bytes
PROVAPRO(5): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x20cb54ba: `599' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(6): :res
PROVAPRO(7): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,412 msec user, 16 msec system
; cpu time (gc)     1,010 msec user, 0 msec system
; cpu time (total)  9,422 msec user, 16 msec system
; real time  15,172 msec
; space allocation:
;  67,212,309 cons cells, 542,150,160 other bytes, 0 static bytes
PROVAPRO(8): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x208e455a: `#5\?' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(9): :res
PROVAPRO(10): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,135 msec user, 31 msec system
; cpu time (gc)     802 msec user, 0 msec system
; cpu time (total)  8,937 msec user, 31 msec system
; real time  15,407 msec
; space allocation:
;  67,212,309 cons cells, 542,150,160 other bytes, 0 static bytes
PROVAPRO(11): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,331 msec user, 16 msec system
; cpu time (gc)     763 msec user, 0 msec system
; cpu time (total)  9,094 msec user, 16 msec system
; real time  15,469 msec
; space allocation:
;  67,212,311 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(12): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,191 msec user, 31 msec system
; cpu time (gc)     653 msec user, 0 msec system
; cpu time (total)  8,844 msec user, 31 msec system
; real time  15,437 msec
; space allocation:
;  67,212,312 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(13): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 7,918 msec user, 47 msec system
; cpu time (gc)     816 msec user, 0 msec system
; cpu time (total)  8,734 msec user, 47 msec system
; real time  15,687 msec
; space allocation:
;  67,212,315 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(14): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,013 msec user, 31 msec system
; cpu time (gc)     862 msec user, 0 msec system
; cpu time (total)  8,875 msec user, 31 msec system
; real time  15,531 msec
; space allocation:
;  67,212,311 cons cells, 542,148,096 other bytes, 0 static bytes
PROVAPRO(15): (test)

(1 2 3 4 5 6 7 8 9 10)
7.302022964372767d-5
(PAR (SER (PAR (SER 1 2) (PAR (SER 3 4) (PAR 5 (SER 6 7)))) 8)
  (PAR 9 10))
; cpu time (non-gc) 8,029 msec user, 62 msec system
; cpu time (gc)     705 msec user, 0 msec system
; cpu time (total)  8,734 msec user, 62 msec system
; real time  15,657 msec
; space allocation:
;  67,212,311 cons cells, -3,752,819,200 other bytes, 0 static bytes
PROVAPRO(16): (test)

(1 2 3 4 5 6 7 8 9 10)
Error: `#<Printer Error, obj=#x20cb323a: `97482' is not of the expected type `LIST'>'
        is not of the expected type `NUMBER'
   [condition type: TYPE-ERROR]

Restart actions (select using :continue):
  0: Return to Top Level (an "abort" restart).
  1: Abort entirely from this (lisp) process.
[1] PROVAPRO(17): :res
PROVAPRO(18): (lisp-implementation-version)
"8.0 [Windows] (Jul 22, 2006 16:44)"
PROVAPRO(19):


Gmane