2 ms·
> the difference between ASCII and binary files This one is a bit confusing. In DOS/Windows land, files are just files, always binary. The distinction betwee
by Dwedit 3y ago
> the difference between ASCII and binary files
This one is a bit confusing. In DOS/Windows land, files are just files, always binary. The distinction between "ASCII" and "Binary" only exists at the time you call "fopen" (a C function), then failing to open in binary mode causes it to mangle your data by inserting CR before every LF.
- bitwize 3y agoNot all operating systems have file systems that take the Unixoid "a file is just a hunk of bytes on disk with a name" (which convention DOS, Windows, and Mac also use). Some file systems do distinguish between text and binary files; others have fixed record sizes, or provide fixed-record-size files in addition to random-access hunks of bytes. Mainframe and DEC mini operating systems come to mind.
- fuzztester 3y agoSorry, loose wording or brain fart there. I meant text files vs. binary files, as in, you can open text files in a text editor and see their contents, but if you open a binary file in a text editor, you get what appears to be garbage, but that is not an error, because of all the non-printable characters they often contain. But at one level you are right, of course, files are just files. It is the higher layers of software and humans that give different interpretations to them, such as text vs binary.