MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / file_stat

Function file_stat

src/sync.rs:88–93  ·  view source on GitHub ↗

Get filesystem mtime (seconds since epoch) and size for pre-filter.

(path: &Path)

Source from the content-addressed store, hash-verified

86
87/// Get filesystem mtime (seconds since epoch) and size for pre-filter.
88pub 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.
96pub fn content_hash(content: &str) -> String {

Callers 6

process_requestFunction · 0.85
extract_files_in_processFunction · 0.85
sync_single_filesMethod · 0.85
reindex_fileMethod · 0.85

Calls

no outgoing calls

Tested by 1