Discussion:
[clisp-list] How to open file descriptor with CLISP?
Jean Louis
2017-01-25 09:35:40 UTC
Permalink
I am looking into solution to open file descriptor in CLISP, and to
get its fileno, that I can feed files to GNU mailutils, mail program
to file descriptors.

Basically, into functionality that is shown in the sample Perl program
here: http://mailutils.org/wiki/Mail:_sending_attachments -- relating
to opening file descriptor and getting its number.

Jean
Sam Steingold
2017-01-25 19:42:14 UTC
Permalink
Post by Jean Louis
I am looking into solution to open file descriptor in CLISP, and to
get its fileno, that I can feed files to GNU mailutils, mail program
to file descriptors.
Basically, into functionality that is shown in the sample Perl program
here: http://mailutils.org/wiki/Mail:_sending_attachments -- relating
to opening file descriptor and getting its number.
There is function ext:stream-handles which should be documented in
http://clisp.org/impnotes/stream-handles.html
I have no idea why it is only documented in the beta docs
http://clisp.org/beta/impnotes/stream-handles.html.

There goes my zorkmid. :-(
--
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504
http://steingoldpsychology.com http://www.childpsy.net
http://mideasttruth.com http://thereligionofpeace.com http://no2bds.org
Me, sarcastic?! Yeah, right...
Jean Louis
2017-01-25 20:36:11 UTC
Permalink
Post by Sam Steingold
Post by Jean Louis
I am looking into solution to open file descriptor in CLISP, and to
get its fileno, that I can feed files to GNU mailutils, mail program
to file descriptors.
Basically, into functionality that is shown in the sample Perl program
here: http://mailutils.org/wiki/Mail:_sending_attachments -- relating
to opening file descriptor and getting its number.
There is function ext:stream-handles which should be documented in
http://clisp.org/impnotes/stream-handles.html
I have no idea why it is only documented in the beta docs
http://clisp.org/beta/impnotes/stream-handles.html.
There goes my zorkmid. :-(
Oh thanks!
Jean Louis
2017-03-11 18:04:37 UTC
Permalink
Post by Sam Steingold
Post by Jean Louis
I am looking into solution to open file descriptor in CLISP, and to
get its fileno, that I can feed files to GNU mailutils, mail program
to file descriptors.
Basically, into functionality that is shown in the sample Perl program
here: http://mailutils.org/wiki/Mail:_sending_attachments -- relating
to opening file descriptor and getting its number.
There is function ext:stream-handles which should be documented in
http://clisp.org/impnotes/stream-handles.html
I have no idea why it is only documented in the beta docs
http://clisp.org/beta/impnotes/stream-handles.html.
An error has been encountered in accessing this page.

1. Server: clisp.sourceforge.net
2. URL path: /impnotes/stream-handles.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2017-03-11 18:05:21 UTC (1489255521)

Do you know what happened with it?

As now I am searching again for the documentation.

Jean
Karsten Poeck
2017-03-11 20:39:44 UTC
Permalink
Post by Jean Louis
An error has been encountered in accessing this page.
1. Server: clisp.sourceforge.net
2. URL path: /impnotes/stream-handles.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2017-03-11 18:05:21 UTC (1489255521)
Do you know what happened with it?
Works for me

21.18. Function EXT:STREAM-HANDLES

The function (EXT:STREAM-HANDLES stream) returns two values:

The OS file descriptor for the input side of the stream, or NIL if the
stream is an output-only STREAM or if there is no file descriptor
associated with it.
The OS file descriptor for the output side of the stream, or NIL if the
stream is an input-only STREAM or if there is no file descriptor
associated with it.
Warning

It is dangerous to CLOSE the file descriptors returned by this function.
This may lead to EBADF OS ERRORs and, eventually, segmentation faults.
Always use CLOSE on the original Lisp streams instead.

These notes document CLISP version 2.49+
Sam Steingold
2017-03-13 01:03:51 UTC
Permalink
Post by Jean Louis
Post by Sam Steingold
Post by Jean Louis
I am looking into solution to open file descriptor in CLISP, and to
get its fileno, that I can feed files to GNU mailutils, mail program
to file descriptors.
Basically, into functionality that is shown in the sample Perl program
here: http://mailutils.org/wiki/Mail:_sending_attachments -- relating
to opening file descriptor and getting its number.
There is function ext:stream-handles which should be documented in
http://clisp.org/impnotes/stream-handles.html
I have no idea why it is only documented in the beta docs
http://clisp.org/beta/impnotes/stream-handles.html.
An error has been encountered in accessing this page.
1. Server: clisp.sourceforge.net
2. URL path: /impnotes/stream-handles.html
3. Error notes: NONE
4. Error type: 404
5. Request method: GET
6. Request query string: NONE
7. Time: 2017-03-11 18:05:21 UTC (1489255521)
Do you know what happened with it?
As now I am searching again for the documentation.
wfm


--8<---------------cut here---------------start------------->8---
21.18. Function EXT:STREAM-HANDLES

The function (EXT:STREAM-HANDLES stream) returns two values:

The OS file descriptor for the input side of the stream, or NIL if the stream is an output-only STREAM or if there is no file descriptor associated with it.
The OS file descriptor for the output side of the stream, or NIL if the stream is an input-only STREAM or if there is no file descriptor associated with it.
Warning

It is dangerous to CLOSE the file descriptors returned by this function. This may lead to EBADF OS ERRORs and, eventually, segmentation faults. Always use CLOSE on the original Lisp streams instead.

These notes document CLISP version 2.49+ Last modified: 2016-09-05
--8<---------------cut here---------------end--------------->8---
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 16.10 (yakkety) X 11.0.11804000
http://www.childpsy.net/ http://ffii.org http://www.dhimmitude.org
http://jihadwatch.org http://camera.org http://honestreporting.com
Murphy's Law was probably named after the wrong guy.
Loading...