how to open file in binary mode
helo,
i m using fedora 6 . i m writing my application using c,c++ how can i open any file in binary format Regards, Amit |
In C++, you use "ios::binary" as the second argument to your ifstream/ofstream constructor:
ifstream in("foo", ios::binary); ofstream out("foo", ios::binary); Not sure about C. |
files as a binary concept belongs to those inferior O.S's.
there is no binary and ASCII under unix like systems. |
Eh? Why not? :confused:
|
well, in DOS you have ascii and binary, so in ascii if you write a
file it will translate a "\n" to a "\r\n" while in unix a "\n" is a "\n", a file is a file is a file. like the ASCII and binary mode for ftp, if you mix it up on DOS it messes the file up but in unix it doesn't care. another wondeful legacy from mr Gates' crap programming, as well as enabling the internet to fill up with viruses, spam and botnets ;) |
All times are GMT -5. The time now is 06:32 PM. |