Path: utzoo!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: magic cookies given back by ftell, and used in fseek Message-ID: <11004@steinmetz.ge.com> Date: 26 May 88 16:27:31 GMT References: <129@lakart.UUCP> Reply-To: davidsen@kbsvax.steinmetz.UUCP (William E. Davidsen Jr) Organization: General Electric CRD, Schenectady, NY Lines: 32 In article <129@lakart.UUCP> dg@lakart.UUCP (David Goodenough) writes: >There has been much discussion in this group on the fact that on certain >systems (VMS I believe), ftell & fseek use magic cookies to tell about As far as I know the value returned by (f)tell is a real address in the file. The kicker is that the beginning of consecetive ten byte lines may not be ten bytes apart, or even any fixed number of bytes. This is an artifact of VMS having 11 (or so) file types. At one time the C library was so hosed that I gave my SysMgr the following for report as an SPR: Problem: random i/o in VMS-C doesn't work Demo: ... read part of a file ... val1 = ftell(); /* ask where we are */ val2 = ftell(); /* ask again */ if (val1 != val2) { /* this system hasn't a clue... */ fprintf(stderr, "Random file access error\n"); exit(2); } Needless to say I wrote my own i/o routines from scratch, since we couldn't wait for a fix. I'm told that the reply was "This will be fixed in a future release." I'm glad I operate one level away from the vendor (in VMS at least). -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me