need reading file in binary mode

  • Thread starter Sergey P. Vazulia
  • Start date
S

Sergey P. Vazulia

this part of my code:

f = file(work_dir + filename,'r')
n = int(totalSize/recordLenth)
i = 0
while i < n:
buf = f.read(recordLenth);

sometime (when find something like \0A\00\00 in data) returm less bytes then
file have.

Q: how-to read all data from binary file with constant_length portions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top