From: Ingo Krabbe <ikrabbe.ask@web.de>
To: gcc-help@gcc.gnu.org
Cc: thales@virtualbs.com.br
Subject: Re: \n to \r\n in stdout
Date: Mon, 07 Nov 2005 12:41:00 -0000 [thread overview]
Message-ID: <200511071341.26220.ikrabbe.ask@web.de> (raw)
In-Reply-To: <1131365370.436f43fa6f8d6@webmail.virtualbs.com.br>
[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]
This is no compiler problem but a problem of your system (Windows, Dos maybe,
whose behaviour is to do such things).
You can try to change the terminal settings for the stdout line, which has a
flag for such output postprocessings. But such a discussion opens a vast
area of misunderstandings.
Try to set the terminal parameters from your terminal instead. This might
help too.
Or just write directly to a file.
Use dup2 to duplicate your stdout descriptor and set some flags to write in
binary mode to the descriptor might also help (never tried though).
Maybe fdopen(STDOUT_FILENO, "wb"), works too ?!
BYE INGO
Am Montag, 7. November 2005 13:09 schrieb thales@virtualbs.com.br:
> Hi all!
>
> I've looked at so many places that I'm thinking it won't have ways to
> resolve this problem. Then I remembered that exists this discussion list.
>
> So, here is my question:
>
> Please, but please... How can I prevent the compiler of substituting the
> character '\n' for the characters "\r\n"?
>
> I'm trying to open a binary file and print it to the stdout, but
> substituting '\n' for "\r\n", the file generated is corrupted.
>
> Thanks you all!
>
> Gratefully,
> Thales Medeiros.
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-11-07 12:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-07 12:08 thales
2005-11-07 12:24 ` John Love-Jensen
2005-11-07 12:41 ` Ingo Krabbe [this message]
2005-11-07 12:40 thales
2005-11-07 12:52 ` John Love-Jensen
2005-11-07 13:03 thales
2005-11-07 13:08 ` John Love-Jensen
2005-11-07 13:17 ` thales
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200511071341.26220.ikrabbe.ask@web.de \
--to=ikrabbe.ask@web.de \
--cc=gcc-help@gcc.gnu.org \
--cc=thales@virtualbs.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).