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

Andrew Duane aduane at juniper.net
Fri Feb 11 21:48:12 UTC 2011


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
aduane at juniper.net      Westford, MA  01886-3418

________________________________________
From: owner-freebsd-hackers at freebsd.org [owner-freebsd-hackers at freebsd.org] On Behalf Of Julian H. Stacey [jhs at berklix.com]
Sent: Friday, February 11, 2011 4:32 PM
To: hackers at freebsd.org
Subject: reverse of  getchar() read() open() fopen() ?

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 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
--
Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com
 Mail plain text;  Not quoted-printable, Not HTML, Not base 64.
 Reply below text sections not at top, to avoid breaking cumulative context.
_______________________________________________
freebsd-hackers at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list