read from binary file

Stefan Schwarzer s.schwarzer at ndh.net
Wed Jan 26 03:44:08 EST 2000


Hello Stefan ;-)

Stefan Andreatta schrieb:
> [...]
> But the read() function always returns just some 1000 bytes of data and the
> stops.

This is probably due to some "end-of-file character" (Ctrl-Z on DOS,
OS/2, Windows, Ctrl-D on Unix, ? on Mac<-this is an embedded question
(on the character, not the Mac) ;-) ) in the file.

> Does anybody know, what could be the reason for that, and how I could read
> the whole file into a string?

As Ivan pointed out :-)  Additionally, it might be a good thing to
close the file when you don't need it open anymore. (It wasn't clear
from your posting if you finally closed the file.)

Stefan



More information about the Python-list mailing list