summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libcmp.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-06-17 15:11:35 (GMT)
committerFred Drake <fdrake@acm.org>1999-06-17 15:11:35 (GMT)
commit64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e (patch)
tree54532b2bd1198e1fe626a1842574208535299138 /Doc/lib/libcmp.tex
parent668213d3b8876a30c5cec84a0d07590374495aba (diff)
downloadcpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.zip
cpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.tar.gz
cpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.tar.bz2
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Diffstat (limited to 'Doc/lib/libcmp.tex')
-rw-r--r--Doc/lib/libcmp.tex34
1 files changed, 34 insertions, 0 deletions
diff --git a/Doc/lib/libcmp.tex b/Doc/lib/libcmp.tex
new file mode 100644
index 0000000..a30da72
--- /dev/null
+++ b/Doc/lib/libcmp.tex
@@ -0,0 +1,34 @@
+\section{\module{cmp} ---
+ File comparisons}
+
+\declaremodule{standard}{cmp}
+\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
+\modulesynopsis{Compare files very efficiently.}
+
+The \module{cmp} module defines a function to compare files, taking all
+sort of short-cuts to make it a highly efficient operation.
+
+The \module{cmp} module defines the following function:
+
+\begin{funcdesc}{cmp}{f1, f2}
+Compare two files given as names. The following tricks are used to
+optimize the comparisons:
+
+\begin{itemize}
+ \item Files with identical type, size and mtime are assumed equal.
+ \item Files with different type or size are never equal.
+ \item The module only compares files it already compared if their
+ signature (type, size and mtime) changed.
+ \item No external programs are called.
+\end{itemize}
+\end{funcdesc}
+
+Example:
+
+\begin{verbatim}
+>>> import cmp
+>>> cmp.cmp('libundoc.tex', 'libundoc.tex')
+1
+>>> cmp.cmp('libundoc.tex', 'lib.tex')
+0
+\end{verbatim}