I think I saw somewhere about the first byte of a record entry is the length of the entry. Does this sound right? For instance, if I need to read a String of 30 bytes (chars) from a pascal record, do I first need
to read byte 1 to get the true length of the String?
Yes thank you. I figured this to be the case. If I skip the first byte
and readin the string in, will it be properly terminated or do I need
the first byte to know where to terminate the array? I'm using Numpy for my struct to have deterministic byte lengths, e.g., numpy.chararray[30] for string[30].
Another way is to
skip the length, read the whole string (30bytes) and do a strip function to strip empty space at the end of the string. Whatever works for you :)
Sysop: | Eric Oulashin |
---|---|
Location: | Beaverton, Oregon, USA |
Users: | 128 |
Nodes: | 16 (0 / 16) |
Uptime: | 38:44:58 |
Calls: | 1,546 |
Files: | 2,153 |
Messages: | 313,323 |