From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 11 22:04:39 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E9CC1065672 for ; Fri, 11 Feb 2011 22:04:39 +0000 (UTC) (envelope-from dteske@vicor.com) Received: from postoffice.vicor.com (postoffice.vicor.com [69.26.56.53]) by mx1.freebsd.org (Postfix) with ESMTP id CA46F8FC19 for ; Fri, 11 Feb 2011 22:04:38 +0000 (UTC) Received: from [192.82.228.105] (port=63599) by postoffice.vicor.com with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.71) (envelope-from ) id 1Po0id-0000es-2o; Fri, 11 Feb 2011 13:40:00 -0800 From: Devin Teske To: "Julian H. Stacey" In-Reply-To: <201102112132.p1BLWkiP003000@fire.js.berklix.net> References: <201102112132.p1BLWkiP003000@fire.js.berklix.net> Organization: VICOR, Inc. Date: Fri, 11 Feb 2011 13:40:10 -0800 Message-ID: <1297460410.9144.10.camel@dt.vicor.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 X-Scan-Signature: 83be3b23014bddc0a2b81e211cffcda6 X-Scan-Host: postoffice.vicor.com Content-Type: text/plain; charset="cp1252" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: hackers@freebsd.org Subject: Re: reverse of getchar() read() open() fopen() ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2011 22:04:39 -0000 On Fri, 2011-02-11 at 22:32 +0100, Julian H. Stacey wrote: > Hi hackers@, > Do we have C libraries with reverse of getchar() [ & maybe read() > ] & fopen() [ & maybe open() ] etc, to read from end of file toward > beginning ? `tail -r' will spit out lines of a file in reverse-order. Maybe the source to tail(1) can offer some insights: http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/tail/ -- Devin P.S. Sorry for the non-answer. > I dont see anything in the See Also sections. I'm not > looking to write, just read. I'm looking for something that returns > last char in file as first etc, I'm not interested in wchars etc, > I could write some C functions, with seek etc & probably will, if > none exist, but no point if they already exist ? > > Cheers, > Julian