H. Fielding | 1 May 2012 18:19
Picon
Favicon

Please UNSUBSCRIBE NOW

Please do NOT send me any more messages from this list! Thank you!
Didier Verna | 10 May 2012 15:56
X-Face
Face
Picon
Picon
Picon
Picon
Gravatar

accessing a stream's file descriptors


  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

Nick Levine | 10 May 2012 16:04
Favicon
Gravatar

Re: accessing a stream's file descriptors


> 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

Art Obrezan | 10 May 2012 16:37
Picon
Favicon

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

Didier Verna | 10 May 2012 16:50
X-Face
Face
Picon
Picon
Picon
Picon
Gravatar

Re: accessing a stream's file descriptors


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

Paul Tarvydas | 10 May 2012 16:59
Favicon

Re: linux ide question

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


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



Paul Tarvydas | 10 May 2012 17:12
Favicon

Re: accessing a stream's file descriptors

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



Nick Levine | 10 May 2012 17:23
Favicon
Gravatar

Re: accessing a stream's file descriptors


> 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

Didier Verna | 10 May 2012 17:52
X-Face
Face
Picon
Picon
Picon
Picon
Gravatar

Re: accessing a stream's file descriptors


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

Ala'a Mohammad | 10 May 2012 18:04
Picon

linux ide question


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
>


Gmane