using binary mode for fopen()