Recursive directory tree generator for directories. Args: top: string, a Directory name in_order: bool, Traverse in order if True, post order if False. Errors that happen while listing directories are ignored. Yields: Each yield is a 3-tuple: the pathname of a directory, fo
(top, in_order=True)
| 647 | |
| 648 | @tf_export(v1=["gfile.Walk"]) |
| 649 | def walk(top, in_order=True): |
| 650 | """Recursive directory tree generator for directories. |
| 651 | |
| 652 | Args: |
| 653 | top: string, a Directory name |
| 654 | in_order: bool, Traverse in order if True, post order if False. Errors that |
| 655 | happen while listing directories are ignored. |
| 656 | |
| 657 | Yields: |
| 658 | Each yield is a 3-tuple: the pathname of a directory, followed by lists of |
| 659 | all its subdirectories and leaf files. |
| 660 | (dirname, [subdirname, subdirname, ...], [filename, filename, ...]) |
| 661 | as strings |
| 662 | """ |
| 663 | return walk_v2(top, in_order) |
| 664 | |
| 665 | |
| 666 | @tf_export("io.gfile.walk") |