Added 'description' class attribute to every command class (to help the
[python/dscho.git] / Doc / lib / libcmp.tex
blob4f81b3c3281dd825860f9d2f2f380026311944f6
1 \section{\module{cmp} ---
2 File comparisons}
4 \declaremodule{standard}{cmp}
5 \sectionauthor{Moshe Zadka}{mzadka@geocities.com}
6 \modulesynopsis{Compare files very efficiently.}
8 % XXX check version number before release!
9 \deprecated{1.5.3}{Use the \module{filecmp} module instead.}
11 The \module{cmp} module defines a function to compare files, taking all
12 sort of short-cuts to make it a highly efficient operation.
14 The \module{cmp} module defines the following function:
16 \begin{funcdesc}{cmp}{f1, f2}
17 Compare two files given as names. The following tricks are used to
18 optimize the comparisons:
20 \begin{itemize}
21 \item Files with identical type, size and mtime are assumed equal.
22 \item Files with different type or size are never equal.
23 \item The module only compares files it already compared if their
24 signature (type, size and mtime) changed.
25 \item No external programs are called.
26 \end{itemize}
27 \end{funcdesc}
29 Example:
31 \begin{verbatim}
32 >>> import cmp
33 >>> cmp.cmp('libundoc.tex', 'libundoc.tex')
35 >>> cmp.cmp('libundoc.tex', 'lib.tex')
37 \end{verbatim}