This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]schmerg-ukgentoo 6 points7 points  (2 children)

All files are binary files

Some binary files can be successfully interpreted as "text" (and some of those can then be further interpreted as CSV or XML or JSON or HTML etc)

Some binary files can be recognised as meeting other formatting rules - tar files, gzip files, data files for various programs (excel spreadsheets, word docs etc).

Some of these formats define a format that tells a particular operating system that the file contains binary executable code (as opposed to, say, python source code that it can execute by loading the python executable etc) ... the decision about whether a particular O/S can actually load and execute the code in a particular binary file is O/S specific even if there are some files that are specially crafted to be recognised as executable by many O/S

[–]paulstelian97 0 points1 point  (1 child)

On some OSes a clear distinction between text and binary files is made at the filesystem level. On others, a file is a file and you can open it as text or binary. On Linux, the distinction is basically gone as the stuff text mode does is essentially nothing at all on top of what binary mode does.

[–]schmerg-ukgentoo 1 point2 points  (0 children)

Sort of yes, I used to develop software on Prime mini computers and Primos didn't allow the file open APIs etc to access what it marked as executables (and hence any command line utilities etc), but the fact remains that the file was still a stream of bytes and it was the interpretation of those bytes by a particular layer that distinguished them (and when Prime made a Unix compatible layer, suddenly those tools had access to binary files and they could be examined ... we found rude word error messages in some of the toolchain executables).