set both fopen(read and write) to rb and wb correspondingly to work on Windows