Path: utzoo!mnetor!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.os.vms Subject: Re: Bug in VAX C Run-Time Library Message-ID: <209@sdrc.UUCP> Date: 10 Feb 88 02:33:02 GMT References: <880126085340.21e04d69@Csa2.LBL.Gov> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 28 In article <880126085340.21e04d69@Csa2.LBL.Gov>, forrest@LBL.GOV writes: > > What I'm doing is reading records from a file. If I use > ftell to tell me where a certain record is located and then > use fseek to go back to the record, I find that the next > record differs depending on if the input file is a > stream or a variable record file. I too have had this problem from day 1 with VAX C. The problem seems to be that ftell on a record file just gets the current record number out of the FAB (or RAB, or whereever the heck RMS keeps it). Unfortunately, you aren't actually in a record until you read at least one character from it, so the "official" method of using fgets() doesn't help at all - you still haven't read any of the next record so you still get the previous one. As fas as suggestions, I have but two, neither of which is particularly nice: 1) Don't use record files. 2) Do un ungetc(getc(file), file); just before the ftell(). -- ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC MAIL: 2000 Eastman Dr., Milford, OH 45150 AT&T: (513) 576-2070 "When all else fails, read the directions."