tf.gfile.Walk
Stay organized with collections
Save and categorize content based on your preferences.
Recursive directory tree generator for directories.
tf.gfile.Walk(
top, in_order=True
)
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, followed by lists of
all its subdirectories and leaf files.
(dirname, [subdirname, subdirname, ...], [filename, filename, ...])
as strings
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.gfile.Walk\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/lib/io/file_io.py#L648-L663) |\n\nRecursive directory tree generator for directories.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.gfile.Walk`](/api_docs/python/tf/compat/v1/gfile/Walk)\n\n\u003cbr /\u003e\n\n tf.gfile.Walk(\n top, in_order=True\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|-----------------------------------------------------------------------------------------------------------------|\n| `top` | string, a Directory name |\n| `in_order` | bool, Traverse in order if True, post order if False. Errors that happen while listing directories are ignored. |\n\n\u003cbr /\u003e\n\n#### Yields:\n\nEach yield is a 3-tuple: the pathname of a directory, followed by lists of\nall its subdirectories and leaf files.\n(dirname, \\[subdirname, subdirname, ...\\], \\[filename, filename, ...\\])\nas strings"]]