
On 6/9/06, Martin Bonner <martin.bonner@pitechnology.com> wrote:
Well, some of them (DSPs) are freestanding implementations and don't /have/ fgetc. But in general, yes. Of course, on such systems the file will be divided into 9 or 32 bit sized chunks. (Which makes file transfer interesting).
The sockets implementation receive octets down the wire (and they are called octets not bytes because the designers were aware of non-8-bit bytes).
recv will store each octet into a byte (which C and C++ guarantees is big enough). send might just transmit the low eight bits of each byte as the octet, or it might fail if higher bits are non-zero.
That raises an interesting issue. It sounds like (on a platform with 32-bit bytes) for a file the octets would have to be rearranged inside one byte, but for a socket it would need the octets spread out, each into one byte. Would it be worth adding allowed_bits_per_byte ( = CHAR_BIT ) and chunk_size ( = 8 ) parameters to the templates? They certainly wouldn't simplify the implementation. Also, has middle-endian finally died? Contemplative, ~ Scott McMurray