List the descriptors open in this process, or :const:`None`. :const:`None` means this platform has no directory listing them, and the caller has to scan a numeric range instead.
()
| 333 | |
| 334 | |
| 335 | def _open_fds(): |
| 336 | """List the descriptors open in this process, or :const:`None`. |
| 337 | |
| 338 | :const:`None` means this platform has no directory listing them, and the |
| 339 | caller has to scan a numeric range instead. |
| 340 | """ |
| 341 | if SYSTEM in {'DragonFly', 'FreeBSD'} and not _dev_fd_is_fdescfs(): |
| 342 | return None |
| 343 | try: |
| 344 | names = os.listdir(_FD_DIR) |
| 345 | except OSError: |
| 346 | return None |
| 347 | return sorted(int(name) for name in names if name.isdigit()) |
| 348 | |
| 349 | |
| 350 | def close_open_fds(keep=None): |
no test coverage detected