From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Harig Newsgroups: gmane.lisp.guile.bugs Subject: Re: Guile 2.0.0 cannot open /dev/urandom Date: Thu, 17 Feb 2011 23:44:50 -0500 Message-ID: <8CD9D3DB635ABF2-C18-1679C@webmail-m079.sysops.aol.com> References: <201102172258.33666.martin@gkc.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1298004337 2140 80.91.229.12 (18 Feb 2011 04:45:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2011 04:45:37 +0000 (UTC) To: martin@gkc.org.uk, bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Feb 18 05:45:32 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PqIDi-0006tH-NP for guile-bugs@m.gmane.org; Fri, 18 Feb 2011 05:45:30 +0100 Original-Received: from localhost ([127.0.0.1]:36698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqIDd-00040h-0n for guile-bugs@m.gmane.org; Thu, 17 Feb 2011 23:45:25 -0500 Original-Received: from [140.186.70.92] (port=47001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqIDX-0003xn-3f for bug-guile@gnu.org; Thu, 17 Feb 2011 23:45:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqIDV-0005HL-SE for bug-guile@gnu.org; Thu, 17 Feb 2011 23:45:18 -0500 Original-Received: from imr-da03.mx.aol.com ([205.188.105.145]:59106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqIDV-0005H7-PQ for bug-guile@gnu.org; Thu, 17 Feb 2011 23:45:17 -0500 Original-Received: from imo-ma02.mx.aol.com (imo-ma02.mx.aol.com [64.12.78.137]) by imr-da03.mx.aol.com (8.14.1/8.14.1) with ESMTP id p1I4j1FU029387; Thu, 17 Feb 2011 23:45:01 -0500 Original-Received: from idirectscm@aim.com by imo-ma02.mx.aol.com (mail_out_v42.9.) id 7.c56.835efcb4 (45499); Thu, 17 Feb 2011 23:44:55 -0500 (EST) Original-Received: from smtprly-mc03.mx.aol.com (smtprly-mc03.mx.aol.com [64.12.95.99]) by cia-mc08.mx.aol.com (v129.7) with ESMTP id MAILCIAMC086-d3d84d5df942ac; Thu, 17 Feb 2011 23:44:55 -0500 Original-Received: from webmail-m079 (webmail-m079.sim.aol.com [64.12.141.37]) by smtprly-mc03.mx.aol.com (v129.8) with ESMTP id MAILSMTPRLYMC032-d3d84d5df942ac; Thu, 17 Feb 2011 23:44:50 -0500 X-AOL-IP: 98.185.24.91 In-Reply-To: <201102172258.33666.martin@gkc.org.uk> X-MB-Message-Source: WebUI X-MB-Message-Type: User X-Mailer: AIM WebMail 33222-STANDARD Original-Received: from 98.185.24.91 by webmail-m079.sysops.aol.com (64.12.141.37) with HTTP (WebMailUI); Thu, 17 Feb 2011 23:44:50 -0500 X-AOL-SENDER: idirectscm@aim.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 205.188.105.145 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5180 Archived-At: On Thu, Feb 17, 2011 at 10:58:33PM +0000, Martin Ward wrote: > > Guile 1.8.6 can open /dev/urandom (which I use for seeding a random > number generator): > > % guile > guile> (open-input-file "/dev/urandom") > # > guile> > > But guile 2.0.0 gives this error: > > ~/Documents/guile-2.0.0/meta/guile > GNU Guile 2.0.0 > Copyright (C) 1995-2011 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> (open-input-file "/dev/urandom") > ERROR: In procedure open-file: > ERROR: In procedure fport_end_input: Invalid argument > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to=20 continue. > scheme@(guile-user) [1]> ,bt > 0 (open-file "/dev/urandom" "r") > scheme@(guile-user) [1]> > > > -- As a work-around until the Guile developers can decide how this is going to be handled, specifying that the file is to be opened in read-only, binary mode works on bothGuile 2.0 and Guile 1.8. This requires that you use `open-file' instead of `open-input-file': $ guile GNU Guile 2.0.0 Copyright (C) 1995-2011 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (open-file "/dev/urandom" "rb") $1 =3D # scheme@(guile-user)> ,q $ /usr/bin/guile guile> (version) "1.8.7" guile> (open-file "/dev/urandom" "rb") # guile> The file, /dev/urandom, will then be opened in read-only mode for both versions of Guile. --