wdiff for Windows
This is a port of the original GNU wdiff
utility to Windows.
The GNU
wdiff
program is a front end todiff
for comparing files on a word per word basis. A word is anything between whitespace. It works by creating two temporary files, one word per line, and then executesdiff
on these files. It collects thediff
output and uses it to produce a nicer display of word differences between the original files.
The executable wdiff.exe
has been compiled using
MSVC 12.0 (using /MT so it has no dependency on the msvcrt
runtime)
and should run on any version of Windows from XP upwards.
You can recompile using MinGW if you wish.
diff utility
The diff
utility is also required for wdiff
to work.
The executable diff.exe
is also included in this
distribution [md5=1b79ced2b4e7c4a2122256d584e9ad4b].
This identifies itself as 'GNU diffutils version 2.7' and was
originally downloaded from Karl M. Syring's
GNU
utilities for Win32.
The relevant download link on that page no longer appears to work.
Downloads
- Binaries: wdiff-0.5.1W.bin.zip (106 kB).
- Source: wdiff-0.5.1W.src.zip (34 kB).
Installing
Copy the two executables in the bin
subfolder into
a suitable directory in your Windows System PATH.
You know what to do. No messy make and recompile install procedure
needed for Windows.
Test
Use wdiff
to compare the test files
lao.txt and tzu.txt.
> wdiff lao.txt tzu.txt The [-Way that can be told of is not the eternal Way; The name that can be named is not the eternal name. The-] Nameless is the origin of Heaven and Earth; The [-Named-] {+named+} is the mother of all things. Therefore let there always be non-being, so we may see their subtlety, And let there always be being, so we may see their outcome. The two are the same, But after they are produced, they have different names. {+They both may be called deep and profound. Deeper and more profound, The door of all subtleties!+}
Compiling
The complete source code to recreate wdiff
is in
the src
subfolder. The Makefile
works
with MinGW.
The vcxproj
file is for MSVC 12.0.
Notes on the port
-
We started with the original 0.5.0 version of wdiff because the essential logic of the core code is unchanged but it uses less of the GNU-specific extensions that the later versions do, and this makes porting it easier.
-
The TERMCAP and PAGER features are not supported.
-
The interrupt mechanisms haven't been tested. We've left the code in, though.
-
Removed old kludges for pre-ANSI include files and replaced leading spaces in the source code by tabs.
-
Added our own
tmpfileplus
code to create the temporary files in a more secure manner than the original (yes, this is addressed in later versions of wdiff, but that uses a GNU-specific function not available to Windows compilers). -
Re-wrote the
readpipe()
function to avoid the Linux-specificpipe
, andfork
functions. Thewritepipe()
function is left in as a placeholder since it is only used for the PAGER feature, which is not supported.
Contact us
To comment on this page or to contact us, please send us a message.
This page first published 12 June 2016. Last updated 13 June 2016.