Yield path objects of the directory contents. The children are yielded in arbitrary order, and the special entries '.' and '..' are not included.
(self)
| 1025 | return path |
| 1026 | |
| 1027 | def iterdir(self): |
| 1028 | """Yield path objects of the directory contents. |
| 1029 | |
| 1030 | The children are yielded in arbitrary order, and the |
| 1031 | special entries '.' and '..' are not included. |
| 1032 | """ |
| 1033 | root_dir = str(self) |
| 1034 | with os.scandir(root_dir) as scandir_it: |
| 1035 | entries = list(scandir_it) |
| 1036 | if root_dir == '.': |
| 1037 | return (self._from_dir_entry(e, e.name) for e in entries) |
| 1038 | else: |
| 1039 | return (self._from_dir_entry(e, e.path) for e in entries) |
| 1040 | |
| 1041 | def glob(self, pattern, *, case_sensitive=None, recurse_symlinks=False): |
| 1042 | """Iterate over this subtree and yield all existing files (of any |