I'm not sure that you'd want to use "p" with binary files. (I haven't checked, but I'm thinking it might be applicable only for text files.) Try specifying "b" - and if that fixes things then you've found the problem. Otherwise, it's probably as Jim said.