home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8618 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.3 KB  |  41 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!spool.mu.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: BIG blockwrites!
  5. Message-ID: <dmurdoch.430.728087097@mast.queensu.ca>
  6. Lines: 29
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <728098043.AA00331@f262.n620.z3.fidonet.org>
  10. Date: Tue, 26 Jan 1993 22:24:58 GMT
  11.  
  12. In article <728098043.AA00331@f262.n620.z3.fidonet.org> tp923021@jarrah.canberra.edu.au (ben elliston) writes:
  13.  
  14. >blockwrite(thefile, struct_1, sizeof(struct_1));
  15. >blockwrite(thefile, struct_2, sizeof(struct_2));
  16. >blockwrite(thefile, struct_2, sizeof(struct_3));
  17.  
  18. >1.  Struct_2 has three null-terminated fields.  These contain people's names.
  19. >These names are NOWHERE to be found when viewing the file with Xtree (in hex
  20. >view mode).
  21.  
  22. >2.  The total size of the structures is about 300 bytes. The file, when
  23. >closed, goes well over 30k in size!  I've seen this before, and I never worked
  24. >out what I actually did to fix it.
  25.  
  26. These are very suggestive of the usual bug with blockwrite use:  you probably
  27. opened the file with 128 byte records.  Use
  28.  
  29.  Reset(f,1);
  30.  
  31. instead of
  32.  
  33.  Reset(f);
  34.  
  35. and they'll probably go away.  Even better:  switch to using streams.
  36.  
  37.  
  38.  
  39. Duncan Murdoch
  40. dmurdoch@mast.queensu.ca
  41.