---
source: crates/ruff_linter/src/rules/flake8_use_pathlib/mod.rs
---
PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
 --> PTH204.py:6:1
  |
6 | os.path.getmtime("filename")
  | ^^^^^^^^^^^^^^^^
7 | os.path.getmtime(b"filename")
8 | os.path.getmtime(Path("filename"))
  |
help: Replace with `Path.stat(...).st_mtime`
  |
5 |
  - os.path.getmtime("filename")
6 + Path("filename").stat().st_mtime
7 | os.path.getmtime(b"filename")
  |

PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
 --> PTH204.py:7:1
  |
6 | os.path.getmtime("filename")
7 | os.path.getmtime(b"filename")
  | ^^^^^^^^^^^^^^^^
8 | os.path.getmtime(Path("filename"))
  |
help: Replace with `Path.stat(...).st_mtime`
  |
6 | os.path.getmtime("filename")
  - os.path.getmtime(b"filename")
7 + Path(b"filename").stat().st_mtime
8 | os.path.getmtime(Path("filename"))
  |

PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
 --> PTH204.py:8:1
  |
6 | os.path.getmtime("filename")
7 | os.path.getmtime(b"filename")
8 | os.path.getmtime(Path("filename"))
  | ^^^^^^^^^^^^^^^^
  |
help: Replace with `Path.stat(...).st_mtime`
  |
7 | os.path.getmtime(b"filename")
  - os.path.getmtime(Path("filename"))
8 + Path("filename").stat().st_mtime
9 |
  |

PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
  --> PTH204.py:11:1
   |
11 | getmtime("filename")
   | ^^^^^^^^
12 | getmtime(b"filename")
13 | getmtime(Path("filename"))
   |
help: Replace with `Path.stat(...).st_mtime`
   |
10 |
   - getmtime("filename")
11 + Path("filename").stat().st_mtime
12 | getmtime(b"filename")
   |

PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
  --> PTH204.py:12:1
   |
11 | getmtime("filename")
12 | getmtime(b"filename")
   | ^^^^^^^^
13 | getmtime(Path("filename"))
   |
help: Replace with `Path.stat(...).st_mtime`
   |
11 | getmtime("filename")
   - getmtime(b"filename")
12 + Path(b"filename").stat().st_mtime
13 | getmtime(Path("filename"))
   |

PTH204 [*] `os.path.getmtime` should be replaced by `Path.stat().st_mtime`
  --> PTH204.py:13:1
   |
11 | getmtime("filename")
12 | getmtime(b"filename")
13 | getmtime(Path("filename"))
   | ^^^^^^^^
   |
help: Replace with `Path.stat(...).st_mtime`
   |
12 | getmtime(b"filename")
   - getmtime(Path("filename"))
13 + Path("filename").stat().st_mtime
   |
