Re: Writing 10

From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 09/14/04


Date: 13 Sep 2004 22:58:35 -0700

Phillip Mills <phillip.mills1@acmDELETE.org> wrote in message news:<41461d82_2@127.0.0.1>...

[ ... ]

> > That's simply not true -- Windows does nothing of the sort.
>
> Actually it is *simply* true -- in other words, true for practical
> purposes. It only becomes questionable when you complicate it with
> unnecessary pedantry.

No -- not true for practical, or any other, purposes. You might be
able to argue that it was true for practical purposes if it was
required that every possible implementation of C++ for Windows acted
the same way -- but that's not the case, and in fact there are C++
compilers available for Windows that do NOT do such a translation. As
such, it's an important distinction because if the OP used a different
compiler on Windows, he'd find different behavior. If he believe that
it was Windows itself that caused the behavior in the first place,
this would lead to still greater confusion.
 
> > The translation is done by the C runtime library,
>
> You're just specifying which part of the Windows system is being
> annoying, not actually contradicting anything.

Perhaps that's the case on your planet, but it certainly isn't true
here on planet earth.

> > and it happens
> > because you've _asked_ it to,
>
> No, it happens without being "asked" anything of the sort. It
> __defaults__ to writing more bytes than it was told to and more bytes
> than it does on other systems under the same conditions. If the OP had
> been required to ask for that behavior, he would probably not have
> joined the legions who have stumbled on it over the years.

Quite the contrary -- the C standard specifies that translated mode is
the default, yes. That means that when you don't specify ios::binary,
you're _asking_ it to do whatever translation is needed to conform to
the local "customs" for a text file.

The fact that you've asked for this behavior tacitly doesn't change
the fact that you have asked for it. If the OP intends to learn to
program in C++, he needs to learn what parameters mean what when
calling standard library functions. Trying to teach him nonsense and
then claiming that it's true for practical purposes is NOT doing him
any favor.
 
> > not because it "thinks it's smarter than
> > you are". I'd also note that Windows is hardly alone in defining text
> > mode such that translated mode really involves doing a translation.
>
> Right.... DOS, too.

This makes you sound narrow-minded and ignorant. In addition to the
DOS, OS/2, Windows family, MacOS, VMS, z/OS, etc. require translation
of text files. On MacOS the translation is different from on Windows,
but about equally trivial. On VMS, z/OS, and a whole host of older IBM
mainframe OSes, the translations involved are decidedly less trivial,
to put it mildly.

-- 
    Later,
    Jerry.
The universe is a figment of its own imagination.


Relevant Pages

  • Re: Writing 10
    ... That's simply not true -- Windows does nothing of the sort. ... mode such that translated mode really involves doing a translation. ...
    (comp.lang.cpp)
  • Re: Studying abroad, devastating weird laptop problem
    ... Translate.google.com may help you with the translation. ... - Normal Mode, Safe Mode with Networking, etc.), but no Safe Mode works ... load but it quickly slows down to a crawl, and takes about a minute to ... After this, Windows Calendar ...
    (microsoft.public.windows.vista.general)
  • Re: If Windows is so great...
    ... for admitting that for the purposes of hosting your Web ... >>> site, Windows is good enough. ... The real Joe ...
    (comp.sys.mac.advocacy)
  • Re: how to allow/deny access to cd-rom to various users on windows 2k?
    ... I am going to develop a client server based device-locking software. ... He says it is for Windows 2000 but not whether it is a server version ... In the beginning getting the drive type is what filemon does when it ... So I stopped using the project for even my personal purposes. ...
    (microsoft.public.development.device.drivers)
  • RE: Understanding the virtual to physical address translation rule in
    ... Under Windows NT, 0x300th entry of a page directory holds the physical ... translation is done, and everything will become clear to you.... ... the excerpt from my article speaks ...
    (microsoft.public.development.device.drivers)