Get filesystem mtime (seconds since epoch) and size for pre-filter.
(path: &Path)
| 86 | |
| 87 | /// Get filesystem mtime (seconds since epoch) and size for pre-filter. |
| 88 | pub fn file_stat(path: &Path) -> Option<(i64, u64)> { |
| 89 | let meta = std::fs::metadata(path).ok()?; |
| 90 | let mtime = meta.modified().ok()?; |
| 91 | let secs = mtime.duration_since(std::time::UNIX_EPOCH).ok()?.as_secs() as i64; |
| 92 | Some((secs, meta.len())) |
| 93 | } |
| 94 | |
| 95 | /// Compute SHA-256 content hash of file content. |
| 96 | pub fn content_hash(content: &str) -> String { |
no outgoing calls