From: mark.d.witmer@gmail.com
To: guile-user@gnu.org
Subject: Re: asynchronous socket library
Date: Sun, 25 Aug 2013 18:26:04 -0400 [thread overview]
Message-ID: <87ppt1o1ab.fsf@gmail.com> (raw)
In-Reply-To: 87d2p2bwq6.fsf@tines.lan
Mark H Weaver <mhw@netris.org> writes:
>
> First of all, that '(close-port port)' is wrong. Here you are trying to
> tell Guile how to close 'port', and this just recurses. I guess it
> should be (close-port auth-file)'.
That's right. It's two bugs, actually---closing the file would cause an
infinite loop and I didn't catch it because I never actually closed the file!
>
> However, I don't see why this custom port is needed at all. You've
> already opened 'auth-file' in binary mode, so you should be able to use
> it directly, i.e. replace the above code with:
>
> (define port (open-file (getenv "XAUTHORITY") "rb"))
>
Ok, I finally get what you're saying... procedures like
'get-bytevector-n' or 'put-u8' and so forth work just fine on ports that
are opened in binary mode---no custom binary ports needed!
Reading the manual gave me the impression that there was a fundamental
difference between file ports opened in binary mode as described in
section 6.14.9.1, and R6RS binary input/output ports as described in
sections 6.14.10.8 and 6.14.10.11. Now that you've explained it to me,
it makes sense that procedures that call for the latter would work on
the former as well.
--
Mark Witmer
prev parent reply other threads:[~2013-08-25 22:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 23:41 asynchronous socket library Aleix Conchillo Flaqué
2013-07-16 1:03 ` Nala Ginrut
2013-07-16 1:42 ` Aleix Conchillo Flaqué
2013-07-16 6:15 ` Javier Sancho
2013-07-16 7:02 ` Aleix Conchillo Flaqué
2013-07-16 7:03 ` Aleix Conchillo Flaqué
2013-07-16 7:36 ` Chaos Eternal
2013-07-16 15:24 ` Aleix Conchillo Flaqué
2013-07-16 15:58 ` Chaos Eternal
2013-07-16 17:02 ` Aleix Conchillo Flaqué
2013-07-16 7:50 ` Thien-Thi Nguyen
2013-07-16 15:26 ` Aleix Conchillo Flaqué
2013-07-17 6:07 ` mark
2013-07-17 7:13 ` Mark H Weaver
2013-07-17 16:49 ` mark
2013-08-24 21:33 ` Mark H Weaver
2013-08-25 22:26 ` mark.d.witmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ppt1o1ab.fsf@gmail.com \
--to=mark.d.witmer@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).