Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!jimp From: jimp@cognos.uucp (Jim Patterson) Newsgroups: comp.emacs Subject: Re: GNU Emacs performance Message-ID: <936@aldebaran.UUCP> Date: Thu, 18-Jun-87 17:33:40 EDT Article-I.D.: aldebara.936 Posted: Thu Jun 18 17:33:40 1987 Date-Received: Fri, 19-Jun-87 03:37:32 EDT References: <8706091546.AA01577@icst-cmr.arpa.ARPA> <1201@xanth.UUCP> <1206@xanth.UUCP> Reply-To: jimp@aldebaran.UUCP (Jim Patterson) Organization: Cognos Incorporated, Ottawa, Canada Lines: 38 In article <1206@xanth.UUCP> john@xanth.UUCP writes: >I also wanted to mention what VMS EDT does with regard to reading in >files. It starts up only reading in the first few blocks of the file, >and reads in the rest as you move through the file. ... >I'm hoping someone out there knows of an editor that reads in chunks >of the file as it needs them, and yet deals somehow with the >possibility of getting an inconsistent file. Does anyone have any >ideas on that? You could do this with a unix-type file, i.e. one with newlines to separate logical lines. You can just jump to a block near the end of the file and scan forward to a newline. You wouldn't be able to tell the line-number that you are currently editing, though. VMS has a filetype that is similar to this called stream_lf. (It's fairly recent, having been introduced in VMS 4.0 or maybe even later). However, most text files under VMS are stored as variable-length RMS files which means that there is a one-word count of characters preceeding each record which tells how big it is. Usually there is no explicit newline. With this structure there is no reliable way that you can jump into the middle of the file and re-synchronize yourself to a record boundary. Any algorithms to do so have to make assumptions about what characters are valid or aren't valid in a file. If you assume that the file contains no actual NULs and that line-lengths are not in excess of 255 characters then you can locate the record breaks by locating NUL characters. (The preceding character will then be the length of the next line). However, to do even this requires that you bypass RMS (or use RMS block I/O), since RMS will return records from a variable-length file only sequentially. (There may be a way to fool it once you've located the record you want to position to, but I'm not enough of an RMS wizard to comment on how). -- Jim Patterson decvax!utzoo!dciem!nrcaer!cognos!jimp Cognos Incorporated