On Sep 5, 9:55 am, "deepakvs...@gmail.com" <deepakvs...@gmail.com>
wrote:
On Sep 5, 12:52 pm, Lionel B <m...@privacy.netwrote:
On Tue, 04 Sep 2007 20:55:14 -0700, deepakvs...@gmail.com wrote:
are binary files portable?
I hope so - aren't all computer files binary?
what about binary files created in c++?? are they portable?
Whether a file is "portable" or not is independant of whether it
is text or binary. A file is portable to all systems which
understand its format.
Typically, of course, binary files are more portable than text
files, because computer programmers seem to be more aware of the
portability problems involving binary files. But anyone who has
opened a file written under Unix with Notepad knows that text
files aren't very portable. Not to mention when you start
having to deal with different encodings. And of course, if the
target program expects HTML, and you've output LaTeX, there's
going to be a portability problem as well.
C++ itself doesn't make any assumtions about file format. Text
or binary, it's up to the creating program to format. About the
only difference is that C++ does provide formatting and parsing
for the built-in types (e.g. int, double) for a number of
typical text formats, but no formatting or parsing for binary
formats. The historical reason for this is probably that Unix
(where C and C++ grew up) only uses binary formats for a very
few machine dependent files: object files or executables, for
example, which by their very nature aren't portable.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34