1 May 2012 18:19
10 May 2012 15:56
accessing a stream's file descriptors
Didier Verna <didier <at> lrde.epita.fr>
2012-05-10 13:56:02 GMT
2012-05-10 13:56:02 GMT
Hello, I need to access the output file descriptor of a stream (so that I can pass it to a CFFI foreign function. Allegro has excl::stream-output-handle and CLISP has ext:stream-handles for instance. What is the equivalent in Lispworks? thank you! -- -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
10 May 2012 16:04
Re: accessing a stream's file descriptors
Nick Levine <ndl <at> ravenbrook.com>
2012-05-10 14:04:38 GMT
2012-05-10 14:04:38 GMT
> From: Didier Verna <didier <at> lrde.epita.fr> > Date: Thu, 10 May 2012 15:56:02 +0200 > > Hello, > > I need to access the output file descriptor of a stream (so that I can > pass it to a CFFI foreign function. Allegro has > excl::stream-output-handle and CLISP has ext:stream-handles for > instance. What is the equivalent in Lispworks? CL-USER 41 > setf x (open "~/foo") #<STREAM::LATIN-1-FILE-STREAM C:\users\nick\foo> CL-USER 42 > STREAM::OS-FILE-HANDLE-STREAM-FILE-HANDLE x 1376 CL-USER 43 > STREAM::%L1FILE-STREAM-FILE-HANDLE x 1376 CL-USER 44 > Is that what you were after? -n
10 May 2012 16:37
linux ide question
Art Obrezan <artobrezan <at> yahoo.com>
2012-05-10 14:37:08 GMT
2012-05-10 14:37:08 GMT
Hello - LW 6.1 linux 32bits. When it starts there are two windows, the "main" one with a toolbar and menus and the listener window. The "main" window is actually of no use because one can access all tools via menus in listener, editor, etc. windows. I can manually close that "main" window after the startup and proceed with work. Question: how can I automatically close that "main" window during the startup? Any tricks to add to the .lispworks file? Best, Art
10 May 2012 16:50
Re: accessing a stream's file descriptors
Didier Verna <didier <at> lrde.epita.fr>
2012-05-10 14:50:54 GMT
2012-05-10 14:50:54 GMT
Nick Levine wrote: > CL-USER 41 > setf x (open "~/foo") > #<STREAM::LATIN-1-FILE-STREAM C:\users\nick\foo> > > CL-USER 42 > STREAM::OS-FILE-HANDLE-STREAM-FILE-HANDLE x > 1376 > > CL-USER 43 > STREAM::%L1FILE-STREAM-FILE-HANDLE x > 1376 > > CL-USER 44 > > > Is that what you were after? Thanks Nick (for the two colons. But that does not always work. In particular, this function won't accept a SYSTEM::TERMINAL-STREAM which is what I get when using *STANDARD-OUTPUT* (with some bits of canonicalization). -- -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
10 May 2012 16:59
Re: linux ide question
Paul Tarvydas <paul.tarvydas <at> rogers.com>
2012-05-10 14:59:57 GMT
2012-05-10 14:59:57 GMT
I keep that window up, since it provides a convenient way to shut LW down and close all windows.
But, if you really want to, try:
1. use Works >> Window Browser to find the name (string) for that window
2. from the listener try (mp:find-process-from-name "LispWorks 6.1.0 on <your-machine-name>")
3. (mp:process-kill *)
If that works (it did for me), then read up on define-action and put a (define-action "Initialize LispWorks Tools" ...) in your .lispworks. I
think.
pt
From: Art Obrezan <artobrezan <at> yahoo.com>
To: lisp-hug <at> lispworks.com
Sent: Thursday, May 10, 2012 10:37:08 AM
Subject: linux ide question
To: lisp-hug <at> lispworks.com
Sent: Thursday, May 10, 2012 10:37:08 AM
Subject: linux ide question
Hello -
LW 6.1 linux 32bits. When it starts there are two windows, the "main" one with a toolbar and menus and the listener window. The "main" window is actually of no use because one can access all tools via menus in listener, editor, etc. windows. I can manually close that "main" window after the startup and proceed with work.
Question: how can I automatically close that "main" window during the startup? Any tricks to add to the .lispworks file?
Best,
Art
10 May 2012 17:12
Re: accessing a stream's file descriptors
Paul Tarvydas <paul.tarvydas <at> rogers.com>
2012-05-10 15:12:53 GMT
2012-05-10 15:12:53 GMT
That's not necessarily an FD, e.g. in IDE mode *standard-output* is an editor stream, not a file descriptor.
It would be an FD if you delivered the app. So, inspect (interactively) *terminal-stream* to figure out what the fields are, then deliver a test app that displays the values of these fields. With luck, you might see where the FD (handle) is.
pt
10 May 2012 17:23
Re: accessing a stream's file descriptors
Nick Levine <ndl <at> ravenbrook.com>
2012-05-10 15:23:14 GMT
2012-05-10 15:23:14 GMT
> From: Didier Verna <didier <at> lrde.epita.fr> > Date: Thu, 10 May 2012 16:50:54 +0200 > > Thanks Nick (for the two colons. But that does not always > work. In particular, this function won't accept a > SYSTEM::TERMINAL-STREAM which is what I get when using > *STANDARD-OUTPUT* (with some bits of canonicalization). Not a clue then. Sorry. - nick
10 May 2012 17:52
Re: accessing a stream's file descriptors
Didier Verna <didier <at> lrde.epita.fr>
2012-05-10 15:52:43 GMT
2012-05-10 15:52:43 GMT
Tim Bradshaw <tfb <at> cley.com> wrote: > I don't think all streams even have file descriptors. Yeah, that's true. It seems to me that TERMINAL-STREAMs should, though. As per Paul's suggestion, I introspected a bit and the only thing I could see so far is a slot named OUTPUT-HANDLE which sounds kinda nice, but its value for *terminal-io* is T, not an fd... :-/ > On the mac implementation there's a class > stream::os-file-handle-stream, and I guess those are the ones that > correspond to filehandles in the underlying system. Probably (hence Nick's suggestion). However, even in a standalone console application (delivered from Lispworks), a TERMINAL-STREAM such as *terminal-io* has no relation with an OS stream, and that currently escapes me... -- -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
10 May 2012 18:04
linux ide question
Ala'a Mohammad <amalawi <at> gmail.com>
2012-05-10 16:04:18 GMT
2012-05-10 16:04:18 GMT
Hi, I'm using the following in my .lispworks ;; initially from http://article.gmane.org/gmane.lisp.lispworks.general/3122 ;; the small annoying window toolbar is called lispworks-echo-podium ;; note that lispwoks has lispworks-podium, but is not exported (defparameter *the-echo-podium* nil) (define-action "CAPI Create Interface" "catch the echo podium" #'(lambda (interface) (when (typep interface 'lw-tools:lispworks-echo-podium) (capi:hide-interface interface nil) (setf *the-echo-podium* interface)))) ;; I tried to kill the podium in the previous stage, but it seems that it is being checked for at startup, so I needed to catch it, ;; and then kill it later on (define-action "Initialize LispWorks Tools" "Kill this echo podium" #'(lambda (obj) (declare (ignore obj)) (capi:quit-interface *the-echo-podium* :force t)) :after "Create default the tools" :before "Run the environment start up functions") HIH, Regards, Ala'a On Thu, May 10, 2012 at 6:37 PM, Art Obrezan <artobrezan <at> yahoo.com> wrote: > > Hello - > > LW 6.1 linux 32bits. When it starts there are two windows, the "main" one with a toolbar and menus and the listener window. The "main" window is actually of no use because one can access all tools via menus in listener, editor, etc. windows. I can manually close that "main" window after the startup and proceed with work. > > Question: how can I automatically close that "main" window during the startup? Any tricks to add to the .lispworks file? > > Best, > Art >




. But that does not always work. In
particular, this function won't accept a SYSTEM::TERMINAL-STREAM which
is what I get when using *STANDARD-OUTPUT* (with some bits of
canonicalization).


RSS Feed