tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] how to get Unix style line endings for output (just \


From: John Refling
Subject: Re: [Tinycc-devel] how to get Unix style line endings for output (just \n not \r\n) --- works when writing to a file, not when redirecting stdout on command line
Date: Tue, 5 Mar 2013 11:05:59 -0800

Yes, your suggestion works perfectly!  Thank you.

Just curious though, where would developers go to find information specific
to tinycc like this?

I'd like to learn more of the tinycc details.  Is there a list of all the
tinycc extensions somewhere?

I believe that I searched the Internet, the tinycc site, & mailing list
archives, and didn't come up with anything relevant.

And it seems that the setmode() on Unix has a different syntax and slightly
different purpose, so I didn't pursue that one initially.

Thanks again,

John Refling




From:   Roy Tam 
Subject:        Re: [Tinycc-devel] how to get Unix style line endings for
output (just \n not \r\n) --- works when writing to a file, not when
redirecting stdout on command line      
Date:   Tue, 5 Mar 2013 07:58:07 +0800  

Hi,

2013/3/5 John Refling <address@hidden>:
> I'm writing binary data to a file.  The data may contain 0xa ( = \n, NL,
^J
> ).
>
> When I open the output file within the program with ` fopen("file",
"wb");'
> the data is written correctly.  
>
> However, if within the program I write the data to stdout, and then on
> command line
>
> redirect stdout to my file, the file seems to always contain the undesired
> 0xd (^M) characters.
>
> Is there some way to redirect purely binary (raw) data to stdout without
> having extra bytes
>
> inserted into the output stream?


Try adding:
   setmode(STDIN_FILENO, O_BINARY);
   setmode(STDOUT_FILENO, O_BINARY);
in the beginning in your main()

<<attachment: winmail.dat>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]