niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » C++
Writing verbatim to file opened in text mode
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Jim Langston
*nix forums Guru


Joined: 15 Jun 2005
Posts: 649

PostPosted: Mon May 29, 2006 11:03 am    Post subject: Re: Writing verbatim to file opened in text mode Reply with quote

<mortenf@gmail.com> wrote in message
news:1148888506.832435.197320@j55g2000cwa.googlegroups.com...
Quote:

I am in need of a method of writing a byte sequence to a file opened in
text mode without translating <lf> ('\n') to <cr><lf> when compiling
for MSDOS platform. Is there a way of skipping this translation and
write the byte sequence byte by byte to the file?

Alternatively, I could open the file in binary mode, but then I need to
figure out how to write real end lines (<lf>, <cr> or <cr><lf>)
according to the target platform.

You're confusing me here. First you say you don't want to translate '\n' to
<cr><lf>, then later you say if you use binary you have to figure out how to
write <lf>, <cr> or <cr><lf> according to the platform.

Which is it?

Carriage return is 0D hex, line feed is 0A hex or 13 and 10 respectively.

I think you just need to use binary mode.
Back to top
mortenf@gmail.com
*nix forums beginner


Joined: 29 May 2006
Posts: 2

PostPosted: Mon May 29, 2006 7:41 am    Post subject: Writing verbatim to file opened in text mode Reply with quote

I am in need of a method of writing a byte sequence to a file opened in
text mode without translating <lf> ('\n') to <cr><lf> when compiling
for MSDOS platform. Is there a way of skipping this translation and
write the byte sequence byte by byte to the file?

Alternatively, I could open the file in binary mode, but then I need to
figure out how to write real end lines (<lf>, <cr> or <cr><lf>)
according to the target platform.

Best regards
Morten Frederiksen
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 4:39 am | All times are GMT
navigation Forum index » Programming » C++
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Oracle Text Score Computation jatinder.1975@gmail.com Server 0 Fri Jul 21, 2006 1:00 pm
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Regarding thesaurus iso file Srikanth modules 0 Fri Jul 21, 2006 10:42 am
No new posts how can i get a file descriptor not used? mars system 0 Fri Jul 21, 2006 7:41 am
No new posts small GTK "Open file" dialog David Siroky Debian 0 Fri Jul 21, 2006 7:30 am

Bad Credit Credit Cards | Loans | Loan | Credit Score | Short Bowel Syndrome
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1827s ][ Queries: 20 (0.1141s) ][ GZIP on - Debug on ]