home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!spool.mu.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: BIG blockwrites!
- Message-ID: <dmurdoch.430.728087097@mast.queensu.ca>
- Lines: 29
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <728098043.AA00331@f262.n620.z3.fidonet.org>
- Date: Tue, 26 Jan 1993 22:24:58 GMT
-
- In article <728098043.AA00331@f262.n620.z3.fidonet.org> tp923021@jarrah.canberra.edu.au (ben elliston) writes:
-
- >blockwrite(thefile, struct_1, sizeof(struct_1));
- >blockwrite(thefile, struct_2, sizeof(struct_2));
- >blockwrite(thefile, struct_2, sizeof(struct_3));
-
- >1. Struct_2 has three null-terminated fields. These contain people's names.
- >These names are NOWHERE to be found when viewing the file with Xtree (in hex
- >view mode).
-
- >2. The total size of the structures is about 300 bytes. The file, when
- >closed, goes well over 30k in size! I've seen this before, and I never worked
- >out what I actually did to fix it.
-
- These are very suggestive of the usual bug with blockwrite use: you probably
- opened the file with 128 byte records. Use
-
- Reset(f,1);
-
- instead of
-
- Reset(f);
-
- and they'll probably go away. Even better: switch to using streams.
-
-
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-