BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hex output to a file

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
JP
Guest





PostPosted: Thu Jun 15, 2006 11:39 pm    Post subject: Hex output to a file Reply with 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.

Thanks,
JP
Back to top
Bruce Salzman
Guest





PostPosted: Thu Jun 15, 2006 11:54 pm    Post subject: Re: Hex output to a file Reply with quote



"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





PostPosted: Fri Jun 16, 2006 12:23 am    Post subject: Re: Hex output to a file Reply with quote



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





PostPosted: Fri Jun 16, 2006 12:41 am    Post subject: Re: Hex output to a file Reply with quote

"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





PostPosted: Fri Jun 16, 2006 12:44 am    Post subject: Re: Hex output to a file Reply with 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.

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





PostPosted: Fri Jun 16, 2006 12:58 am    Post subject: Re: Hex output to a file Reply with quote

"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





PostPosted: Fri Jun 16, 2006 1:03 am    Post subject: Re: Hex output to a file Reply with quote

Quote:

Ok, try "r+b" for binary mode.

--
Bruce


Thanks dude, appreciate the assitance!!! That worked just fine.

JP
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.