473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

file termination

Hi,

I needed to upgrade a driver on my laptop, couldn't get online with it, so I
wrote a down and dirty file splitter enabling me to transfer the new modem
drivers to it via floppy. The .exe was successfully reunited and installed.
Everything works fine; however, the file checksums are not the same before
and after the split and rejoining.

I've tested this with text files and always come up with the same looking
file as I started with after splitting and joining, but the checksums are
different.

This is how I'm appending the file file bytes to the rejoined file:

_tfopen(GetFilename().c_str(), _T("ab"));

....and then just looping through the bytes of the next buffer without adding
or subtracting any terminating char's, or EOF {which seems to happen
automatically when I'm finished anyways}.

I can't figure why the checksums are different.
--
joe
/*------- A new survey of online daters found that
47% of people believe that their online date will
go well... the other 53% are still missing. -------*/
Jul 22 '05 #1
3 1686
flintridgeparkenfarker vonkerschnauzerheiden wrote:
Hi,

I needed to upgrade a driver on my laptop, couldn't get online with it, so I
wrote a down and dirty file splitter enabling me to transfer the new modem
drivers to it via floppy. The .exe was successfully reunited and installed.
Everything works fine; however, the file checksums are not the same before
and after the split and rejoining.

I've tested this with text files and always come up with the same looking
file as I started with after splitting and joining, but the checksums are
different.

This is how I'm appending the file file bytes to the rejoined file:

_tfopen(GetFilename().c_str(), _T("ab"));


How does this function look like ?
Also did you remember to open the file in binary mode while reading and
writing ?

--
Karthik.
Jul 22 '05 #2

"Karthik Kumar" <ka*******************@yahoo.com> wrote in message
news:41e36f64$1@darkstar...
flintridgeparkenfarker vonkerschnauzerheiden wrote:
Hi,

I needed to upgrade a driver on my laptop, couldn't get online with it, so I wrote a down and dirty file splitter enabling me to transfer the new modem drivers to it via floppy. The .exe was successfully reunited and installed. Everything works fine; however, the file checksums are not the same before and after the split and rejoining.

I've tested this with text files and always come up with the same looking file as I started with after splitting and joining, but the checksums are different.

This is how I'm appending the file file bytes to the rejoined file:

_tfopen(GetFilename().c_str(), _T("ab"));


How does this function look like ?
Also did you remember to open the file in binary mode while reading and
writing ?

--
Karthik.

Yeah, this is the function:

ushort FileSplitter::Append(uchar bytes[], ulong size) {
FILE *_file = _tfopen(GetFilename().c_str(), _T("ab"));
if (_file==NULL) {
cout << _T("Couldn't open file to append.") << endl;
return 0;
}
for (ulong i=0; i < size; i++) {
_ftprintf(_file, _T("%c"), bytes[i]);
}
fclose(_file);
return 1;
}

I mean, if a modem driver installation can be broken into 3 pcs, rejoined
and then still install and function properly, what in the * could be
changing the checksum?
Jul 22 '05 #3
I found the problem. It was something I had changed while debugging prior to
making my last copy. Dumb oversight.

Thanks though.
"Karthik Kumar" <ka*******************@yahoo.com> wrote in message
news:41e36f64$1@darkstar...
flintridgeparkenfarker vonkerschnauzerheiden wrote:
Hi,

I needed to upgrade a driver on my laptop, couldn't get online with it, so I wrote a down and dirty file splitter enabling me to transfer the new modem drivers to it via floppy. The .exe was successfully reunited and installed. Everything works fine; however, the file checksums are not the same before and after the split and rejoining.

I've tested this with text files and always come up with the same looking file as I started with after splitting and joining, but the checksums are different.

This is how I'm appending the file file bytes to the rejoined file:

_tfopen(GetFilename().c_str(), _T("ab"));


How does this function look like ?
Also did you remember to open the file in binary mode while reading and
writing ?

--
Karthik.

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
0
by: sangui | last post by:
Helllo. this is biginner programmer. Would u check the file that I programed on c#(winform)? I tryed to make the program reading the binary file by C# programming but I failed. If u have...
0
by: sangui | last post by:
Hello. this is beginner programmer. If u have more time, would you check this code.? please give me the answer how to slove this problem...? ÷ ==> wtmpx.dat α ...
10
by: Craig Bumpstead | last post by:
Hi, I was wondering the best and fastest way to determine how many lines are in a log file. At the moment I am simply doing a StreamReader.ReadLine and incrementing a counter until I reach...
8
by: MLH | last post by:
Am trying to import 20,000+ lines of text in a file FTP'd from a UNIX platform to windows via FTP session in a DOS box. About 2000 records have multiple lines in them separated by CRLF's. ...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
7
by: bowlderster | last post by:
Hello, all. This is the text file named test.txt. 1041 1467 7334 9500 2169 7724 3478 3358 9962 7464 6705 2145 6281 8827 1961 1491 3995 3942 5827 6436 6391 6604 4902 1153 1292 4382 9421 1716...
24
by: allpervasive | last post by:
hi all, this is reddy, a beginner to c lang,,here i have some problems in reading and modifying the contents of a file,, hope you can help to solve this problem. Here i attach the file to be...
23
by: lisp9000 | last post by:
I wrote a small test program to read a file of data and print each line, but it's only printing the 2nd line out of 3 total lines. The test file, "foo.txt", has 3 lines: 7388: Zn->Z0 Run...
29
by: pereges | last post by:
By main file, I mean the one which contains the main routine. Can some one please provide suggestions as to how I can improve the organization of main file ? I have just though about a rough...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.