Thanks for the nice suggestions! As a side question, you mentioned opening files in binary mode, in case the code needs to run under Windows or cross-platform. What would happen otherwise? Is it an issue of big little endian or some other issue?