(self, selector)
| 324 | return infos |
| 325 | |
| 326 | def get_file_info_selector(self, selector): |
| 327 | if not self.fs.isdir(selector.base_dir): |
| 328 | if self.fs.exists(selector.base_dir): |
| 329 | raise NotADirectoryError(selector.base_dir) |
| 330 | else: |
| 331 | if selector.allow_not_found: |
| 332 | return [] |
| 333 | else: |
| 334 | raise FileNotFoundError(selector.base_dir) |
| 335 | |
| 336 | if selector.recursive: |
| 337 | maxdepth = None |
| 338 | else: |
| 339 | maxdepth = 1 |
| 340 | |
| 341 | infos = [] |
| 342 | selected_files = self.fs.find( |
| 343 | selector.base_dir, maxdepth=maxdepth, withdirs=True, detail=True |
| 344 | ) |
| 345 | for path, info in selected_files.items(): |
| 346 | _path = path.strip("/") |
| 347 | base_dir = selector.base_dir.strip("/") |
| 348 | # Need to exclude base directory from selected files if present |
| 349 | # (fsspec filesystems, see GH-37555) |
| 350 | if _path != base_dir: |
| 351 | infos.append(self._create_file_info(path, info)) |
| 352 | |
| 353 | return infos |
| 354 | |
| 355 | def create_dir(self, path, recursive): |
| 356 | # mkdir also raises FileNotFoundError when base directory is not found |
nothing calls this directly
no test coverage detected