MCPcopy Create free account
hub / github.com/python/cpython / rlistdir

Function rlistdir

Lib/test/test_shutil.py:116–126  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

114 return fp.read()
115
116def rlistdir(path):
117 res = []
118 for name in sorted(os.listdir(path)):
119 p = os.path.join(path, name)
120 if os.path.isdir(p) and not os.path.islink(p):
121 res.append(name + '/')
122 for n in rlistdir(p):
123 res.append(name + '/' + n)
124 else:
125 res.append(name)
126 return res
127
128def supports_file2file_sendfile():
129 # ...apparently Linux and Solaris are the only ones

Calls 5

listdirMethod · 0.80
islinkMethod · 0.80
joinMethod · 0.45
isdirMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…