unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Martin Ward <martin@gkc.org.uk>
Cc: bug-guile@gnu.org, Mike Gran <spk121@yahoo.com>
Subject: Re: Guile 2.0.0 cannot open /dev/urandom
Date: Thu, 03 Mar 2011 12:57:54 +0100	[thread overview]
Message-ID: <m3bp1sifgd.fsf@unquote.localdomain> (raw)
In-Reply-To: <m362s5rt6i.fsf@unquote.localdomain> (Andy Wingo's message of "Sun, 27 Feb 2011 23:47:33 +0100")

Hi Martin,

On Sun 27 Feb 2011 23:47, Andy Wingo <wingo@pobox.com> writes:

> On Thu 17 Feb 2011 23:58, Martin Ward <martin@gkc.org.uk> writes:
>
>> scheme@(guile-user)> (open-input-file "/dev/urandom")
>> ERROR: In procedure open-file:
>> ERROR: In procedure fport_end_input: Invalid argument
>
> It seems that Guile is scanning the first few lines of the file for a
> "coding" declaration.  This is because it is being opened in textual
> mode; if you open with (open-file "/dev/urandom" "rb") you will probably
> get what you want.

I have fixed the (open-input-file "/dev/urandom") case, by having the
coding: scan use the read buffer if possible, to avoid a seek.  That
should catch all cases of interest.

Regards,

Andy
-- 
http://wingolog.org/



      reply	other threads:[~2011-03-03 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 22:58 Guile 2.0.0 cannot open /dev/urandom Martin Ward
2011-02-18  4:44 ` Mark Harig
2011-02-27 22:47 ` Andy Wingo
2011-03-03 11:57   ` Andy Wingo [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=m3bp1sifgd.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=bug-guile@gnu.org \
    --cc=martin@gkc.org.uk \
    --cc=spk121@yahoo.com \
    /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).