MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / visit

Function visit

tools/python-3.11.9-amd64/Tools/scripts/findlinksto.py:27–40  ·  view source on GitHub ↗
(prog, dirname, names)

Source from the content-addressed store, hash-verified

25 os.walk(dirname, visit, prog)
26
27def visit(prog, dirname, names):
28 if os.path.islink(dirname):
29 names[:] = []
30 return
31 if os.path.ismount(dirname):
32 print('descend into', dirname)
33 for name in names:
34 name = os.path.join(dirname, name)
35 try:
36 linkto = os.readlink(name)
37 if prog.search(linkto) is not None:
38 print(name, '->', linkto)
39 except OSError:
40 pass
41
42if __name__ == '__main__':
43 main()

Callers

nothing calls this directly

Calls 4

readlinkMethod · 0.80
printFunction · 0.50
joinMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected