In article <728098043.AA00331@f262.n620.z3.fidonet.org> tp923021@jarrah.canberra.edu.au (ben elliston) writes:
>I'm trying to write out several structures to a typed file on disk.
^^^^^
*** So, you are specifying a certain record size.
Reset(typed_file) is equivalent to Reset(untyped_file, SizeOf(yourtype));
>
>I'm using:
>
>blockwrite(thefile, struct_1, sizeof(struct_1));
>blockwrite(thefile, struct_2, sizeof(struct_2));
>blockwrite(thefile, struct_2, sizeof(struct_3));
^^^^^^^^^^^^^^^^
*** The actual number of bytes written will be:
sizeof(struct_3)*SizeOf(yourtype)
Third parameter in BlockRead/Write is multiplied by the second
parameter of Reset command to produce actual block size.
>
>.. and so on. Only about 3 of them anyway.
>
>The problems are:
>
>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).
*** This is unclear. Maybe you've got more bugs :-(
>
>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.