Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcmp.tex @ 12357:5b59ea41db4e legacy-trunk
Install the docs (with fewer rules).
Add descriptions for the system variables.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 10 Apr 2000 19:36:27 +0000 |
| parents | c8155d05d9ca |
| children | d7864345b1c8 |
| rev | line source |
|---|---|
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 \section{\module{cmp} --- |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 File comparisons} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
4 \declaremodule{standard}{cmp} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \sectionauthor{Moshe Zadka}{mzadka@geocities.com} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 \modulesynopsis{Compare files very efficiently.} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
7 |
|
11414
c8155d05d9ca
Added deprecation notes, in case anyone decides to read these anyway.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
8 % XXX check version number before release! |
|
c8155d05d9ca
Added deprecation notes, in case anyone decides to read these anyway.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
9 \deprecated{1.5.3}{Use the \module{filecmp} module instead.} |
|
c8155d05d9ca
Added deprecation notes, in case anyone decides to read these anyway.
Fred Drake <fdrake@acm.org>
parents:
10996
diff
changeset
|
10 |
|
10996
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
11 The \module{cmp} module defines a function to compare files, taking all |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
12 sort of short-cuts to make it a highly efficient operation. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
13 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 The \module{cmp} module defines the following function: |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
15 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
16 \begin{funcdesc}{cmp}{f1, f2} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
17 Compare two files given as names. The following tricks are used to |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
18 optimize the comparisons: |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 \begin{itemize} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 \item Files with identical type, size and mtime are assumed equal. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 \item Files with different type or size are never equal. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 \item The module only compares files it already compared if their |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 signature (type, size and mtime) changed. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 \item No external programs are called. |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 \end{itemize} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 \end{funcdesc} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
29 Example: |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
30 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
31 \begin{verbatim} |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
32 >>> import cmp |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 >>> cmp.cmp('libundoc.tex', 'libundoc.tex') |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
34 1 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
35 >>> cmp.cmp('libundoc.tex', 'lib.tex') |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
36 0 |
|
84ab14d85763
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
37 \end{verbatim} |
