Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsrgv.UUCP Path: utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.unix Subject: Re: C help wanted Message-ID: <421@utcsrgv.UUCP> Date: Tue, 6-Nov-84 20:35:16 EST Article-I.D.: utcsrgv.421 Posted: Tue Nov 6 20:35:16 1984 Date-Received: Tue, 6-Nov-84 20:42:47 EST References: <19300024@uiucdcsb.UUCP> Reply-To: dave@utcsrgv.UUCP (Dave Sherman) Organization: The Law Society of Upper Canada, Toronto Lines: 19 In article <19300024@uiucdcsb.UUCP> becker@uiucdcsb.UUCP (Craig Becker) writes: ~| ~| i have a program that generates a rather complex model of an object ~| (this is for computer graphics) that is composed of records. each record ~| contains data and pointers to other records. this entire data structure ~| is irregular. how can i save this structure in a file so that it can ~| be used by another program? keep in mind that this structure is not ~| tree-like in any way; it more closely resembles something a spider did ~| under influence of drugs. Store all the data in structures declared in consecutive locations in memory, and save it in a file with a single write(2) call with address beginning at the start of all the records, and a size large enough to cover all the data. Read it in the same way. It's cheating, but it works. Dave Sherman Toronto -- { allegra cornell decvax ihnp4 linus utzoo }!utcsrgv!dave