Re: [Alephmodular-devel] Random rumblings on files and errors
Status: Pre-Alpha
Brought to you by:
brefin
From: Michael A. <mdm...@ya...> - 2003-01-30 11:46:28
|
--- Dietrich Epp <die...@zd...> wrote: > > On Wednesday, January 29, 2003, at 08:44 , Br'fin > wrote: > > > I've been mucking with a spare copy of AM, > actually trying to implement > > what I have described in my draft so far. Which is > of course turning up > > more areas to work upon. > > > > Like, most files are going to be opened in binary > mode. So this makes a > > reasonable default, however, some files in the > future are going to be > > text based, so we should support that as well. I > was thinking of > > exposing the iostream openmode flags as part of > the > > open_file_for_reading/writing business. And just > have it default to > > binary. You could clear it of course by passing 0 > for the mode (or a > > suitably equivalent definition) > > Is there really a difference between text and binary > mode? I thought > that was all arcane. I've never liked C++ > iostreams, they have only > served to add compile time and code size in the > megabytes to my projects. Yes, there is a difference. I've had files incorrectly read when the wrong one is used. Just like ASCII vs. Binary FTP it can become a problem when newlines are converted. This happens on at leat Win32 because a \n in code becomes a \r\n in the file and vise versa. I've seen quite a few bugs happen that way. Michael D. Adams mdm...@ya... __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |