This becomes apparent when reading from /dev/zero and writing to a file - the file never grows, even though it should be filling with zeroes. If my data has a zero byte, this is taken as the "end-of-string" terminator ('\0') by os.write() and nothing is written past that. The problem I am having is that os.write() takes a string as a parameter. That function is near the top of this code listing. However he has a _readblock() function that reads binary data, so I co'opted that and modified to to work with fd's. I have reading and writing the data back out working, although I am not using the class's read/write_bits_to/from_fileobject() functions as they read/write characters '1' and '0' instead of actual binary data. I'm using Avinash Kak's BitVector to modify the data as it goes through my program. ![]() ![]() So I have a program in Python for use on a Linux machine that's dealing with binary data flowing through what may be a Linux FIFO.
0 Comments
Leave a Reply. |