Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2011 13:40:10 -0800
From:      Devin Teske <dteske@vicor.com>
To:        "Julian H. Stacey" <jhs@berklix.com>
Cc:        hackers@freebsd.org
Subject:   Re: reverse of  getchar() read() open() fopen() ?
Message-ID:  <1297460410.9144.10.camel@dt.vicor.com>
In-Reply-To: <201102112132.p1BLWkiP003000@fire.js.berklix.net>
References:  <201102112132.p1BLWkiP003000@fire.js.berklix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1297460410.9144.10.camel>