how can i write binary file.like jpg,mp3,pdf i used 'wb' but after it is saved as a text file.if i put'hay \x0
O' or any hex string it will writed as binary mode.if i put only 'hay' or any text it will writed as text file.