With findutils 4.2.15, find -depth seems not always to find all matching
files.
The attached script creates a number of files and directories (the order
in which these are created and appear in the directory may be of
significance). "find 1 -depth -type d" should output
1/2/3
1/2/20
1/2/37
1/2/54
1/2/55/56
1/2/55/57
1/2/55/58
1/2/55/59
1/2/55
1/2
1
but instead outputs just
1/2/54
1/2/55/56
1/2/55/57
1/2/55/58
1/2/55/59
1/2/55
Debugging output from a --enable-debug build:
debug_stat (/)
debug_stat (/var)
debug_stat (/usr/src)
debug_stat (/home)
debug_stat (/proc)
debug_stat (/dev/pts)
debug_stat (/dev/shm)
cur_day_start = Mon Feb 14 00:19:44 2005
Predicate List:
( type ) and print
Eval Tree:
pred = and type = bi_op prec = and addr = 0x805e128
left:
pred = type type = primary prec = no addr = 0x805d020
Needs type
left:
right:
right:
pred = print type = primary prec = no addr = 0x805e1a0
left:
right:
Normalized Eval Tree:
pred = and type = bi_op prec = and addr = 0x805e128
left:
pred = and type = bi_op prec = and addr = 0x805e218
left:
right:
pred = type type = primary prec = no addr = 0x805d020
Needs type
left:
right:
right:
pred = print type = primary prec = no addr = 0x805e1a0
left:
right:
Optimized Eval Tree:
pred = and type = bi_op prec = and addr = 0x805e128
left:
pred = and type = bi_op prec = and addr = 0x805e218
Needs type
left:
right:
pred = type type = primary prec = no addr = 0x805d020
Needs type
left:
right:
right:
pred = print type = primary prec = no addr = 0x805e1a0
left:
right:
Optimized command line:
[type needed here] type and print
debug_stat (.)
debug_stat (1)
pathname = 1, stop_at_current_level = 0
debug_stat (1)
safely_chdir(): chdir("1")
debug_stat (.)
debug_stat (2)
pathname = 1/2, stop_at_current_level = 0
debug_stat (2)
safely_chdir(): chdir("2")
debug_stat (.)
debug_stat (3)
pathname = 1/2/3, stop_at_current_level = 0
debug_stat (3)
safely_chdir(): chdir("3")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
debug_stat (20)
pathname = 1/2/20, stop_at_current_level = 0
debug_stat (20)
safely_chdir(): chdir("20")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
debug_stat (37)
pathname = 1/2/37, stop_at_current_level = 0
debug_stat (37)
safely_chdir(): chdir("37")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
debug_stat (54)
pathname = 1/2/54, stop_at_current_level = 0
debug_stat (54)
safely_chdir(): chdir("54")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/54
debug_stat (55)
pathname = 1/2/55, stop_at_current_level = 0
debug_stat (55)
safely_chdir(): chdir("55")
debug_stat (.)
debug_stat (56)
pathname = 1/2/55/56, stop_at_current_level = 0
debug_stat (56)
safely_chdir(): chdir("56")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/55/56
debug_stat (57)
pathname = 1/2/55/57, stop_at_current_level = 0
debug_stat (57)
safely_chdir(): chdir("57")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/55/57
debug_stat (58)
pathname = 1/2/55/58, stop_at_current_level = 0
debug_stat (58)
safely_chdir(): chdir("58")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/55/58
debug_stat (59)
pathname = 1/2/55/59, stop_at_current_level = 0
debug_stat (59)
safely_chdir(): chdir("59")
debug_stat (.)
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/55/59
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
1/2/55
debug_stat (..)
safely_chdir(): chdir("..")
debug_stat (.)
debug_stat (.)
chdir_back(): chdir(<starting-point>)
debug_stat (.)
safely_chdir(): chdir(".")
debug_stat (.)
debug_stat (.)
--
Joseph S. Myers
[EMAIL PROTECTED]mkdir 1
mkdir 1/2
mkdir 1/2/3
touch 1/2/3/4
touch 1/2/3/5
touch 1/2/3/6
touch 1/2/3/7
touch 1/2/3/8
touch 1/2/3/9
touch 1/2/3/10
touch 1/2/3/11
touch 1/2/3/12
touch 1/2/3/13
touch 1/2/3/14
touch 1/2/3/15
touch 1/2/3/16
touch 1/2/3/17
touch 1/2/3/18
touch 1/2/3/19
mkdir 1/2/20
touch 1/2/20/21
touch 1/2/20/22
touch 1/2/20/23
touch 1/2/20/24
touch 1/2/20/25
touch 1/2/20/26
touch 1/2/20/27
touch 1/2/20/28
touch 1/2/20/29
touch 1/2/20/30
touch 1/2/20/31
touch 1/2/20/32
touch 1/2/20/33
touch 1/2/20/34
touch 1/2/20/35
touch 1/2/20/36
mkdir 1/2/37
touch 1/2/37/38
touch 1/2/37/39
touch 1/2/37/40
touch 1/2/37/41
touch 1/2/37/42
touch 1/2/37/43
touch 1/2/37/44
touch 1/2/37/45
touch 1/2/37/46
touch 1/2/37/47
touch 1/2/37/48
touch 1/2/37/49
touch 1/2/37/50
touch 1/2/37/51
touch 1/2/37/52
touch 1/2/37/53
mkdir 1/2/54
mkdir 1/2/55
mkdir 1/2/55/56
mkdir 1/2/55/57
mkdir 1/2/55/58
mkdir 1/2/55/59
touch 1/2/60
touch 1/2/61
touch 1/2/62
touch 1/2/63
touch 1/2/64
touch 1/2/65
touch 1/66
touch 1/67
touch 1/68
touch 1/69
touch 1/70
touch 1/71
touch 1/72
touch 1/73
touch 1/74
touch 1/75
touch 1/76
touch 1/77
touch 1/78
touch 1/79
touch 1/80
touch 1/81
_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils