delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/01/18:50:06

From: "Graeme Fenwick" <gfenwick AT BYESPAMprimex DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
References: <004801bdecbb$bb65eaa0$7c2f70c3 AT kgwujunl> <6uvjbt$4f9$1 AT star DOT cs DOT vu DOT nl>
Subject: Re: Strange problem reading/writing binary files.
Date: Thu, 1 Oct 1998 23:12:29 +0100
Lines: 46
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
NNTP-Posting-Host: ppp47-217.dial.nildram.co.uk
Message-ID: <36140675.0@scooby.nildram.co.uk>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hmm.... this was an interesting one.

(The important part of what) Horst Kraemer wrote:
>In fact getc(ifp) doesn't stop reading at ^Z when the file is >opened "rb".
The problem is that by putchar(c) you do send the >character ^Z (032) to
stdout _because_ c is _not_ ==EOF for >^Z with "rb".

Well.... you said it all in your reply really. I kind of had a niggling
suspicion that DOS was in there somewhere, but I wouldn't have guessed that.
For anyone interested, try redirecting the output, and then using "edit" to
look at the resultant file. Which proves exactly what you said. Cheers!
Also, thanks to Eli Zaretskii who gave a similar reply by email and
suggested switching the console into binary mode as one possible solution.
Although in future I'll avoid writing ^Z to stdout instead... :-)

And now some words about my style (or lack of it)... ;-)

Boon van der RJ wrote in message <6uvjbt$4f9
:Graeme Fenwick <gfenwick AT primex DOT co DOT uk> wrote:
:> this *is* a moderated group- right?)
:Wrong, it isn't moderated. And I do recall seeing this

Okay.. sorry to everyone who got deja-vu reading that post. :-)

:it's nicer to read if you reduce the space between code
:and comment to avoid wrap there.

Fair point.

:have the usual nospam-crap and the # of spam I get has reduced to 1 every 2
weeks

Sounds like you were lucky then... I've heard of a *lot* worse. (The reason
my most repost didn't have a spam trap was that I posted to
djgpp AT delorie DOT com, and my email reply settings don't have a munged
address.... oops!)
Yep- having looked at Outlook Express, I realise this is slightly
irritating, and I'll bear this in mind, but the purpose wasn't to annoy
people. Honest :-)

Graeme Fenwick - gfenwick AT BYESPAMprimex DOT co DOT uk
  (Remove "BYESPAM" spam filter when replying by mail)

No comments. ;-)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019