From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: read a reply from the terminal Date: Mon, 16 Jul 2007 21:46:59 +0200 Message-ID: References: <200707140242.l6E2gpBC015778@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1184615241 19576 80.91.229.12 (16 Jul 2007 19:47:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2007 19:47:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 21:47:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IAWXM-0005C0-2e for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2007 21:47:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IAWXL-0003vY-KZ for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2007 15:47:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IAWXH-0003u0-5v for emacs-devel@gnu.org; Mon, 16 Jul 2007 15:47:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IAWXG-0003t9-I6 for emacs-devel@gnu.org; Mon, 16 Jul 2007 15:47:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IAWXG-0003t3-9c for emacs-devel@gnu.org; Mon, 16 Jul 2007 15:47:10 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IAWXF-0006M1-UP for emacs-devel@gnu.org; Mon, 16 Jul 2007 15:47:10 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IAWXD-0006b3-Ac for emacs-devel@gnu.org; Mon, 16 Jul 2007 21:47:07 +0200 Original-Received: from remote5.student.chalmers.se ([129.16.29.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2007 21:47:07 +0200 Original-Received: from bojohan+news by remote5.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2007 21:47:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: remote5.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:0h1Ojb152iS6WEnIVNkjgzqVoYw= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74911 Archived-At: Eli Zaretskii writes: > The terminal can be addressed by name (its device driver name, > something like "/dev/tty1"), right? If so, you can read from that > device as if it were a file. insert-file-contents is a way to read > from files, and it supports reading a certain number of bytes. Ok. But it does not support reading a specified number of bytes when the file is non-regular. (It would be useful if it could.) if (!S_ISREG (st.st_mode)) { not_regular = 1; [...] if (! NILP (replace) || ! NILP (beg) || ! NILP (end)) xsignal2 (Qfile_error, build_string ("not a regular file"), orig_filename); } The manual says It is possible to read a special file (such as a FIFO or an I/O device) with `insert-file-contents', as long as REPLACE and VISIT are `nil'. It should be added that BEG and END have to be nil as well, or someone might want to improve the code. -- Johan Bockgård