(path: Path)
| 181 | |
| 182 | |
| 183 | def _fsync_directory(path: Path) -> None: |
| 184 | if os.name == "nt": |
| 185 | # Windows cannot open a directory handle to fsync it. os.replace is |
| 186 | # atomic on NTFS (no torn/partial state), though without the dir flush |
| 187 | # the rename's durability across a crash is weaker than on POSIX. |
| 188 | return |
| 189 | fd = os.open(path, os.O_RDONLY) |
| 190 | try: |
| 191 | os.fsync(fd) |
| 192 | finally: |
| 193 | os.close(fd) |
| 194 | |
| 195 | |
| 196 | def _default_file_mode() -> int: |
no outgoing calls
no test coverage detected