|
|
|
|
|
|
| Author |
Message |
Jim Langston *nix forums Guru
Joined: 15 Jun 2005
Posts: 649
|
Posted: Mon May 29, 2006 11:03 am Post subject:
Re: Writing verbatim to file opened in text mode
|
|
|
<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
|
Posted: Mon May 29, 2006 7:41 am Post subject:
Writing verbatim to file opened in text mode
|
|
|
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 |
|
 |
|
|
The time now is Fri Jan 09, 2009 4:39 am | All times are GMT
|
|
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
|
|