diff Doc/lib/libcmpcache.tex @ 10996:84ab14d85763 legacy-trunk

New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
author Fred Drake <fdrake@acm.org>
date Thu, 17 Jun 1999 15:11:35 +0000
parents
children c8ed5a14488d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Doc/lib/libcmpcache.tex	Thu Jun 17 15:11:35 1999 +0000
@@ -0,0 +1,36 @@
+\section{\module{cmpcache} ---
+         Efficient file comparisons}
+
+\declaremodule{standard}{cmpcache}
+\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
+\modulesynopsis{Compare files very efficiently.}
+
+The \module{cmpcache} module defines a function to compare files, taking all
+sort of short-cuts to make it a highly efficient operation.
+
+The \module{cmpcache} 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 Signatures (type, size and mtime) are computed via
+              \refmodule{statcache}
+        \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 changed.
+        \item No external programs are called.
+\end{itemize}
+\end{funcdesc}
+
+Example:
+
+\begin{verbatim}
+>>> import cmpcache
+>>> cmpcache.cmp('libundoc.tex', 'libundoc.tex')
+1
+>>> cmpcache.cmp('libundoc.tex', 'lib.tex')
+0
+\end{verbatim}