Path: utzoo!attcan!uunet!mcsun!sunic!uupsi!njin!princeton!udel!wuarchive!zaphod.mps.ohio-state.edu!usc!randvax!ucla-an!stb!lampi From: lampi@stb.uucp (Michael Lampi) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Editing Huge Files, and strategies therein Summary: Linked-Lists & Caches work well Keywords: Linked Lists, Editors Message-ID: <1990Mar7.232809.14112@stb.uucp> Date: 7 Mar 90 23:28:09 GMT References: <25efb778@ralf> Reply-To: lampi@stb.uucp (Michael Lampi) Organization: MDL Corporation, Torrance, CA Lines: 28 When I wrote the Danford Corp. FSE (Full Screen Editor) for use on Apollo workstations, I chose to implement a work file scheme using linked lists. Forward links pointed to subsequent lines, backward links pointed to the previous line. Each line had its own "internal" linked list, permitting unlimited line length, but divided into chunks of 64 bytes. This way, files wouldn't expand too much as they are copied into the work file. You might ask "Doesn't it take a while to copy the input to the work file?", and you would be correct (for large files). However, FSE didn't bother to read more than a couple of screens into the work file at startup, and then copied more as one proceeded into the file. If the user exited (writing the input to the output file), then it copied from the work file everything that was there, followed by the rest of the data from the input file. Very fast, minimal overhead. If one was just browsing, then startup/load time was negligible. Using linked lists like this also provided an easy means of handling multiple active files and easy error recovery, especially since FSE had only a single line from the "current" window in memory at any time. All one could lose on a crash would be the changes to that line. FSE had other advances, such as permitting almost any cursor-addressible terminal to be used with it, providing completely soft keyboards, pattern searches (better than unix), multiple windows, etc. It was written in a standard high-level language that you almost never hear about these days - FORTRAN-77.