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

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!email!ps1.iaee.tuwien.ac.at!Sorokin
  3. From: Sorokin@ps1.iaee.tuwien.ac.at (Sorokin Zhenya)
  4. Subject: Re: BIG blockwrites!
  5. Message-ID: <Sorokin.67.728098488@ps1.iaee.tuwien.ac.at>
  6. Lines: 37
  7. Sender: news@email.tuwien.ac.at
  8. Nntp-Posting-Host: pc77.iaee.tuwien.ac.at
  9. Organization: Inst. of General Electronics and Electroengeneering, TU Vienna
  10. References: <728098043.AA00331@f262.n620.z3.fidonet.org>
  11. Date: Wed, 27 Jan 1993 01:34:48 GMT
  12. Lines: 37
  13.  
  14. In article <728098043.AA00331@f262.n620.z3.fidonet.org> tp923021@jarrah.canberra.edu.au (ben elliston) writes:
  15.  
  16. >I'm trying to write out several structures to a typed file on disk.
  17.                                                  ^^^^^
  18. *** So, you are specifying a certain record size.
  19. Reset(typed_file) is equivalent to Reset(untyped_file, SizeOf(yourtype));
  20.  
  21. >
  22. >I'm using:
  23. >
  24. >blockwrite(thefile, struct_1, sizeof(struct_1));
  25. >blockwrite(thefile, struct_2, sizeof(struct_2));
  26. >blockwrite(thefile, struct_2, sizeof(struct_3));
  27.                                ^^^^^^^^^^^^^^^^   
  28. *** The actual number of bytes written will be:
  29. sizeof(struct_3)*SizeOf(yourtype)
  30. Third parameter in BlockRead/Write is multiplied by the second 
  31. parameter of Reset command to produce actual block size.  
  32.  
  33. >
  34. >.. and so on.  Only about 3 of them anyway.
  35. >
  36. >The problems are:
  37. >
  38. >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).
  39.  
  40. *** This is unclear. Maybe you've got more bugs :-(
  41.  
  42. >
  43. >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.
  44.  
  45. *** This is now clear.
  46.  
  47. Sorokin Zhenya
  48. Vienna, Austria.
  49.  
  50.  
  51.