From: "Michael W. Ryder" <_mwryder@...> Date: 2007-08-22T10:14:57+09:00 Subject: Re: Writing to Binary Files Bertram Scharpf wrote: > Hi, > > Am Mittwoch, 22. Aug 2007, 06:35:32 +0900 schrieb doug meyer: >> I'm having some serious issues writing to a binary file. Can anyone >> give me a hand? >> And could I be having this problem because I'm trying to do this on a >> Linux machine? > > I just repeat what I wrote this afternoon > (). > > The distinction between "text" and "binary" is the archetype > misdesign in DOS and Windows. It means nothing more than > that in "text" mode line ends are translated from "\n" to > "\r\n" what is of no use but to disturb file positions and > string lengths. The only purpose of this is to detain > programmers from doing anything in a non-Microsoft way. > Anywhere else you don't need to care. > > Sorry for the flame but that's the way it is. > > Bertram > > So where do files like database or spreadsheet files fit? They obviously aren't text files, sending one to a printer will only produce garbage or a locked printer. Binary is a useful distinction to denote that a file is not "ready" for use without intervention, either through the OS or a program. Whether Unix treats text differently than anyone else is not of concern as a simple test will show if a file is a Unix "text" file or other text file. I have zero problems moving text files back and forth between Unix and Windows programs. I can even move my "binary" database files between the two without any problems. I can't use either of them to read the database files without a program but that is why it is treated differently.