8 def find(pattern
, dir = os
.curdir
):
10 names
= os
.listdir(dir)
13 if name
in (os
.curdir
, os
.pardir
):
15 fullname
= os
.path
.join(dir, name
)
16 if fnmatch
.fnmatch(name
, pattern
):
18 if os
.path
.isdir(fullname
) and not os
.path
.islink(fullname
):
20 if fnmatch
.fnmatch(name
, p
):
21 if _debug
: print "skip", `fullname`
24 if _debug
: print "descend into", `fullname`
25 list = list + find(pattern
, fullname
)