Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watsol!tbray From: tbray@watsol.UUCP Newsgroups: comp.unix.wizards Subject: Stupid behaviour in fseek()? Message-ID: <130@watsol.UUCP> Date: Thu, 2-Jul-87 13:18:08 EDT Article-I.D.: watsol.130 Posted: Thu Jul 2 13:18:08 1987 Date-Received: Sat, 4-Jul-87 02:42:42 EDT Distribution: comp Organization: New Oxford English Dictionary Project, U of W Lines: 33 fseek() exhibits behaviour which seems to defeat the purpose of stdio. Briefly, it does not notice that small relative fseek() calls may leave the pointer within the current buffer and not require lseek() calls. E.g.: /* reverse stdin to stdout */ main() { register int size; struct stat s; fstat(0, &s); size = s.st_size; --------------------------OR----------------------OR------------------------ fseek(stdin, size - 1, 0);| |size = 0; while(size--) { |while(size--) { |while(size++