| View previous topic :: View next topic |
| Author |
Message |
JP Guest
|
Posted: Thu Jun 15, 2006 11:39 pm Post subject: Hex output to a file |
|
|
Using BDS2006, I am generating a file that is read by another program.
This file is the HEX output of a routine that is run. When I try to output
0x0A I get a preceeding 0x0D and then the 0x0A. How can I stop this
Carriage Return character from slipping into my file?
In debugging my program everything is as it should be until it is
written to the output file.
Thanks,
JP |
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Thu Jun 15, 2006 11:54 pm Post subject: Re: Hex output to a file |
|
|
"JP" <debandjp (AT) eatel (DOT) net> wrote in message
news:4491a96d (AT) newsgroups (DOT) borland.com...
| Quote: | Using BDS2006, I am generating a file that is read by another
program. This file is the HEX output of a routine that is run. When
I try to output 0x0A I get a preceeding 0x0D and then the 0x0A. How
can I stop this Carriage Return character from slipping into my
file?
In debugging my program everything is as it should be until it is
written to the output file.
|
How are you opening the output file?
--
Bruce |
|
| Back to top |
|
 |
JP Guest
|
Posted: Fri Jun 16, 2006 12:23 am Post subject: Re: Hex output to a file |
|
|
| Quote: |
How are you opening the output file?
--
Bruce
|
I am using a Hex editor, or just opening the file in BDS to see what the
output is. The record size is off because of this extra character where
ever there is a 0x0A output. The HEX editor that I am using also shows the
same character.
JP |
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Fri Jun 16, 2006 12:41 am Post subject: Re: Hex output to a file |
|
|
"JP" <debandjp (AT) eatel (DOT) net> wrote in message
news:4491b39d$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
How are you opening the output file?
--
Bruce
I am using a Hex editor, or just opening the file in BDS to see what
the output is. The record size is off because of this extra
character where ever there is a 0x0A output. The HEX editor that I
am using also shows the same character.
|
No, I meant how is your program opening the output file.
--
Bruce |
|
| Back to top |
|
 |
JP Guest
|
Posted: Fri Jun 16, 2006 12:44 am Post subject: Re: Hex output to a file |
|
|
Oh, sorry. Opening with the following:
FILE *fptrX;
fptrX = fopen(NameOfFile, "r+");
Is this what you are asking for? I am using the low level C operations
because of the underlying structures used.
JP
" Bruce Salzman" <bruce (AT) nospam (DOT) org> wrote in message
news:4491b7dc (AT) newsgroups (DOT) borland.com...
| Quote: |
"JP" <debandjp (AT) eatel (DOT) net> wrote in message
news:4491b39d$1 (AT) newsgroups (DOT) borland.com...
How are you opening the output file?
--
Bruce
I am using a Hex editor, or just opening the file in BDS to see what the
output is. The record size is off because of this extra character where
ever there is a 0x0A output. The HEX editor that I am using also shows
the same character.
No, I meant how is your program opening the output file.
--
Bruce
|
|
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Fri Jun 16, 2006 12:58 am Post subject: Re: Hex output to a file |
|
|
"JP" <debandjp (AT) eatel (DOT) net> wrote in message
news:4491b8ab (AT) newsgroups (DOT) borland.com...
| Quote: | Oh, sorry. Opening with the following:
FILE *fptrX;
fptrX = fopen(NameOfFile, "r+");
Is this what you are asking for? I am using the low level C
operations because of the underlying structures used.
|
Ok, try "r+b" for binary mode.
--
Bruce |
|
| Back to top |
|
 |
JP Guest
|
Posted: Fri Jun 16, 2006 1:03 am Post subject: Re: Hex output to a file |
|
|
| Quote: |
Ok, try "r+b" for binary mode.
--
Bruce
|
Thanks dude, appreciate the assitance!!! That worked just fine.
JP |
|
| Back to top |
|
 |
|