open temp file in binary mode (because not working at least under windows server 2003)