How do patches work?

philippe

FYI, I chase trains.
Joined
Mar 24, 2002
Messages
11,437
Location
Bourgondische Kreitz
How do patches work?
Do they write over the sourcecode or adding new fragments or both?
I was always wondering about that
 
They don't write over source code, because first, it's very unlikely that you have the source code for a program, and second, a program is never run directly from the source code. The source code is the text you write, in e.g. C++ or Visual Basic, and is very seldom sent along with the program. You only have the compiled version of it.

In windows, most larger programs are made up of one .exe-file and many .dll-files, which each contain certain functions for the program. The .exe-file is usually used to coordinate these functions and contains the basic features, and .dll-files can e.g. contain graphic accelerators or multiplayer functions.

The main reasons for separating the functions of the program into many different .dll-files is that you can reuse the functions in many different programs, e.g. MS Office apps share several .dll-files, and that when updating the functions/program, you only have to update the files containing the updated functions.

I'm not 100% on all of the above, but if needed someone will probably correct me, but I suspect a patch writes over the files that have been changed with the new files, and also maybe change some settings for the program.:)
 
In the old days, on mainframe computers, a "patch" was exactly what it sounds like - something applied to a program to fix a problem. Because memory was expensive, we would carefully write the new code so it would fit in the same space as the old, and then overwrite that portion of the prgram in memory.

These days, while the basic meaning is the same, we just write code to correct the problem, compile a whole new executable program, and replace the earlier program with it. If you look at the Civ3 patches, for example, you will see that each one is a new civilization.exe file, along with supporting files.

The customer never has to deal with the source code, BTW. ;)

Edit: funxus is right, in that a good modular program only needs to have the necessary modules replaced.

And those of us in the Open Software world (e.g., Linux) can get and tweak source code to most of our applications. ;)
 
These days, it's a new exe program (usually. Sometimes it might be a DLL, or some other type of data file).
 
Back
Top Bottom