Article View: comp.sys.mac.programmer.codewarrior
Article #1054Re: CW "Map newlines to CR" chaos
From: Howard Hinnant
Date: Thu, 07 Mar 2002 21:06
Date: Thu, 07 Mar 2002 21:06
25 lines
2234 bytes
2234 bytes
In article <3C87D3BD.8F0436CD@vernier.com>, Christopher Corbell
<ccorbell@vernier.com> wrote:
| MW Ron wrote:
| [....]
| > (Apple uses one char to signify and end of the
| > line, while UNIX uses another, and Widnows yet another).
| [....]
|
| This is true, and that's why I need literal
| CR's and LF's to remain what-they-are - that file
| I'm opening could have come from my program running
| under Windows or Linux.
There is a prepackaged solution for what you want. It is spelled:
std::fstream s("data.dat", std::ios::binary);
^^^^^^^^^^^^^^^^
Binary mode does nothing but suppress newline translation during file
I/O.
--
Howard Hinnant
Metrowerks
Technical Details
Message-ID:
<070320021606371699%hinnant@antispam.metrowerks.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!204.71.34.15!news-out.cwix.com!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!cyclone.nyroc.rr.com!cyclone-out.nyroc.rr.com!typhoon.nyroc.rr.com.POSTED!not-for-mailReferences:
<3C86BC4F.9930D425@vernier.com> <mwron-452B80.14140007032002@enews.newsguy.com> <3C87D3BD.8F0436CD@vernier.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,1e3721ce480a395b
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,1e3721ce480a395b
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-03-07 13:06:39 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!204.71.34.15!news-out.cwix.com!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!cyclone.nyroc.rr.com!cyclone-out.nyroc.rr.com!typhoon.nyroc.rr.com.POSTED!not-for-mail
Subject: Re: CW "Map newlines to CR" chaos
From: Howard Hinnant <hinnant@antispam.metrowerks.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Reply-To: hinnant@metrowerks.com
Message-ID: <070320021606371699%hinnant@antispam.metrowerks.com>
References: <3C86BC4F.9930D425@vernier.com> <mwron-452B80.14140007032002@enews.newsguy.com> <3C87D3BD.8F0436CD@vernier.com>
Organization: Metrowerks
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 8bit
Mail-Copies-To: nobody
User-Agent: Thoth/1.5.0 (Carbon/OS X)
X-Face: )mY~XFHLw)UOW!W#[Ljvxq6Ja7(g'#F0-g*&puNxR8hEJkd@Oue/70^.)I78\
(%a%&Id211u"l/t.llWo/M|?15XUlx9!IGkdWiEmcasiyg"k;Q9[~XuE+`t2"*n(>nmm
@L/q,TjMd5+H{gASEPDR^$
Lines: 25
Date: Thu, 07 Mar 2002 21:06:37 GMT
NNTP-Posting-Host: 24.95.173.18
X-Complaints-To: abuse@rr.com
X-Trace: typhoon.nyroc.rr.com 1015535197 24.95.173.18 (Thu, 07 Mar 2002 16:06:37 EST)
NNTP-Posting-Date: Thu, 07 Mar 2002 16:06:37 EST