RE: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Andrew Duane
I've never seen any such thing, but I've done similar things a lot. I'd say malloc/read the whole file in and use a decrementing pointer to return the previous character. -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr adu...@juniper.net

Re: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Dan Nelson
In the last episode (Feb 11), Julian H. Stacey said: 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 ? I dont see anything in the See Also sections. I'm not looking to write, just

Re: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Devin Teske
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

Re: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Julian H. Stacey
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 ? 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

Re: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Brian Reichert
On Fri, Feb 11, 2011 at 10:32:46PM +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 ? I dont see anything in the See Also sections. I'm not looking to

Re: reverse of getchar() read() open() fopen() ?

2011-02-11 Thread Julian H. Stacey
Andrew Duane wrote: I've never seen any such thing, but I've done similar things a lot. I'd say malloc/read the whole file in and use a decrementing pointer to return the previous character. Thanks, but I'll need a loop too, as malloc(filesize()) would be too big, as I omitted to say I'll be