file.read() doesn't read the whole file

I V ivlenin at gmail.com
Fri Mar 20 20:58:19 CET 2009


On Fri, 20 Mar 2009 07:03:35 -0700, Sreejith K wrote:
> I'm using the above codes in a pthon-fuse's file class's read function.
> The offset and length are 0 and 4096 respectively for my test inputs.
> When I open a file and read the 4096 bytes from offset, only a few lines
> are printed, not the whole file. Actually the file is only a few bytes.
> But when I tried reading from the Interactive mode of python it gave the
> whole file.

Your example doesn't show what you are doing with "data" after you've 
read it. Presumably you're outputting it somehow, which is where you see 
that it doesn't contain the whole file. But are you sure the problem is 
in the reading, and not in the outputting? Could you show the section of 
the code where you output "data"?



More information about the Python-list mailing list