Return True if `path` exists and is either a regular file or a FIFO.
(path: StrPath)
| 466 | |
| 467 | |
| 468 | def _is_file_or_fifo(path: StrPath) -> bool: |
| 469 | """ |
| 470 | Return True if `path` exists and is either a regular file or a FIFO. |
| 471 | """ |
| 472 | if os.path.isfile(path): |
| 473 | return True |
| 474 | |
| 475 | try: |
| 476 | st = os.stat(path) |
| 477 | except (FileNotFoundError, OSError): |
| 478 | return False |
| 479 | |
| 480 | return stat.S_ISFIFO(st.st_mode) |
no outgoing calls
no test coverage detected
searching dependent graphs…