comparison lib/fts_.h @ 6035:a166800910b5

Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
author Jim Meyering <jim@meyering.net>
date Sun, 14 Aug 2005 14:45:33 +0000
parents c47674a83a78
children 43e3888c56c4
comparison
equal deleted inserted replaced
6034:96149b1bbb32 6035:a166800910b5
86 # define FTS_SEEDOT 0x0020 /* return dot and dot-dot */ 86 # define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
87 # define FTS_XDEV 0x0040 /* don't cross devices */ 87 # define FTS_XDEV 0x0040 /* don't cross devices */
88 # define FTS_WHITEOUT 0x0080 /* return whiteout information */ 88 # define FTS_WHITEOUT 0x0080 /* return whiteout information */
89 89
90 /* There are two ways to detect cycles. 90 /* There are two ways to detect cycles.
91 The lazy way, with which one may process a directory that is a 91 The lazy way (which works only with FTS_PHYSICAL),
92 with which one may process a directory that is a
92 part of the cycle several times before detecting the cycle. 93 part of the cycle several times before detecting the cycle.
93 The `tight' way, whereby fts uses more memory (proportional 94 The `tight' way, whereby fts uses more memory (proportional
94 to number of `active' directories, aka distance from root 95 to number of `active' directories, aka distance from root
95 of current tree to current directory -- see active_dir_ht) 96 of current tree to current directory -- see active_dir_ht)
96 to detect any cycle right away. For example, du must use 97 to detect any cycle right away. For example, du must use
97 this option to avoid counting disk space in a cycle multiple 98 this option to avoid counting disk space in a cycle multiple
98 times, but chown -R need not. 99 times, but chown -R need not.
99 The default is to use the constant-memory lazy way. */ 100 The default is to use the constant-memory lazy way, when possible
101 (see below).
102
103 However, with FTS_LOGICAL (when following symlinks, e.g., chown -L)
104 using lazy cycle detection is inadequate. For example, traversing
105 a directory containing a symbolic link to a peer directory, it is
106 possible to encounter the same directory twice even though there
107 is no cycle:
108 dir
109 ...
110 slink -> dir
111 So, when FTS_LOGICAL is selected, we have to use a different
112 mode of cycle detection: FTS_TIGHT_CYCLE_CHECK. */
100 # define FTS_TIGHT_CYCLE_CHECK 0x0100 113 # define FTS_TIGHT_CYCLE_CHECK 0x0100
101 114
102 # define FTS_OPTIONMASK 0x01ff /* valid user option mask */ 115 # define FTS_OPTIONMASK 0x01ff /* valid user option mask */
103 116
104 # define FTS_NAMEONLY 0x1000 /* (private) child names only */ 117 # define FTS_NAMEONLY 0x1000 /* (private) child names only */