|
From: | Matt |
Subject: | Re: MinGW/Windows CRLF lunacy |
Date: | Mon, 09 May 2005 17:38:27 GMT |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Fedora/1.7.6-1.2.5 |
Paul Pluzhnikov wrote:
Matt <matt@themattfella.zzzz.com> writes:What trick do I have to use to make the file contain exactly the data I send to fwrite?Perhaps open the file in binary mode? fopen("output", "wb"); ^ Cheers,
Much obliged guys. I guess I should have RTFM.The mode string can also include the letter ‘‘b’’ either as a last character or as a character between the characters in any of the two-character strings described above. This is strictly for compatibility with ANSI X3.159-1989 (‘‘ANSI C’’) and has no effect; the ‘‘b’’ is ignored on all POSIX conforming systems, including Linux. (Other systems may treat text files and binary files differently, and adding the ‘‘b’’ may be a good idea if you do I/O to a binary file and expect that your program may be ported to non-Unix environments.)
[Prev in Thread] | Current Thread | [Next in Thread] |