Hello,
I tried to use the GNU diff utilities ‘diff’ and ‘patch’ to update my
project files and keep track of some changes. But, while doing so I run
into some difficulties. The situation is as follows.
I’ve got two directories ‘old’ and ‘new’ with a C+±file called
‘main.cpp’. They only differ in one line. By applying the command
diff --unified=3 --text --recursive old new > patchfile
the patchfile looks like this:
=== patchfile ===
— old/main.cpp 2006-08-23 09:55:24.000000000 +0200
+++ new/main.cpp 2006-08-23 09:55:24.000000000 +0200
@@ -6,6 +6,6 @@
int main( void )
{
- cout << “Hello old world!” << endl;
- cout << “Hello new world!” << endl;
return( EXIT_SUCCESS );
}
=== end =========
After patching the old file with
cd old
patch --verbose --backup --unified --strip=1 < …/patchfile
the old file should be updated with the new line. This procedure works
perfect with LINUX (Fedora distribution) but under QNX 6.3 it fails. Is
there any specific parameter for the two programs I have to use or does
anybody spot another error?
Thanks in advance, Thomas
–
Thomas Reisinger Tel: 0531/391-3826
Dipl.-Ing. (FH) Fax: 0531/391-5194
Institut fuer Regelungstechnik mailto:T.Reisinger@TU-Bs.de
TU Braunschweig http://www.ifr.ing.tu-bs.de