summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Doc/lib/libcmp.tex
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libcmp.tex
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libcmp.tex')
-rw-r--r--sys/src/cmd/python/Doc/lib/libcmp.tex36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libcmp.tex b/sys/src/cmd/python/Doc/lib/libcmp.tex
new file mode 100644
index 000000000..489efee96
--- /dev/null
+++ b/sys/src/cmd/python/Doc/lib/libcmp.tex
@@ -0,0 +1,36 @@
+\section{\module{cmp} ---
+ File comparisons}
+
+\declaremodule{standard}{cmp}
+\sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il}
+\modulesynopsis{Compare files very efficiently.}
+
+\deprecated{1.6}{Use the \refmodule{filecmp} module instead.}
+
+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}