{"record":{"id":"f460806f968d2f8d","repo":"sxyazi/yazi","slug":"atime-not-available","errorCode":null,"errorMessage":"atime not available","messagePattern":"atime not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-fs/src/cha/cha.rs","lineNumber":178,"sourceCode":"\t\t\tself.kind.contains(ChaKind::HIDDEN) || self.kind.contains(ChaKind::SYSTEM),\n\t\t\tself.kind.contains(ChaKind::HIDDEN)\n\t\t)\n\t}\n\n\t#[inline]\n\tpub const fn is_dummy(self) -> bool { self.kind.contains(ChaKind::DUMMY) }\n\n\t#[inline]\n\tconst fn is_reparse(self) -> bool { self.kind.contains(ChaKind::REPARSE) }\n\n\t#[inline]\n\tpub fn is_indirect(self) -> bool { self.is_link() || self.is_reparse() }\n\n\tpub(crate) fn atime_dur(self) -> anyhow::Result<Duration> {\n\t\tif let Some(atime) = self.atime {\n\t\t\tOk(atime.duration_since(UNIX_EPOCH)?)\n\t\t} else {\n\t\t\tbail!(\"atime not available\");\n\t\t}\n\t}\n\n\tpub(crate) fn btime_dur(self) -> anyhow::Result<Duration> {\n\t\tif let Some(btime) = self.btime {\n\t\t\tOk(btime.duration_since(UNIX_EPOCH)?)\n\t\t} else {\n\t\t\tbail!(\"btime not available\");\n\t\t}\n\t}\n\n\tpub(crate) fn ctime_dur(self) -> anyhow::Result<Duration> {\n\t\tif let Some(ctime) = self.ctime {\n\t\t\tOk(ctime.duration_since(UNIX_EPOCH)?)\n\t\t} else {\n\t\t\tbail!(\"ctime not available\");\n\t\t}\n\t}","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-fs/src/cha/cha.rs#L160-L196","documentation":"Cha::atime_dur converts the file's access time to a Duration since the Unix epoch, and bails when the atime field is None. Some platforms or filesystems simply do not report atime, so Cha stores it as an Option. This is a 'data not available' error, not an I/O failure.","triggerScenarios":"Calling cha.atime_dur() on a Cha obtained from a filesystem/platform that does not populate atime (e.g. certain network filesystems, or APIs where atime is not returned).","commonSituations":"Mounts mounted with noatime/relatime where atime is unreliable or absent; virtual filesystems (procfs, squashfs) lacking atime; computing sorting/formatting fields from atime on such entries.","solutions":["Check cha.atime.is_some() (or use atime()) before requesting atime_dur, and skip the field when absent.","Fall back to mtime when atime is unavailable.","Restrict atime-based features to platforms/filesystems known to populate atime."],"exampleFix":"// before\nlet age = cha.atime_dur()?;\n// after\nlet age = cha.atime().map(|t| t.elapsed()).unwrap_or_else(|_| cha.mtime_dur().unwrap_or_default());","handlingStrategy":"fallback","validationCode":"if cha.atime().is_none() { /* use mtime instead */ }","typeGuard":"fn has_atime(cha: Cha) -> bool { cha.atime().is_some() }","tryCatchPattern":"let dur = cha.atime_dur().unwrap_or_else(|_| cha.mtime_dur().unwrap_or_default());","preventionTips":["Never assume all timestamps are present on every filesystem","Prefer the Option-returning accessor before requesting a Duration","Test features on noatime/relatime mounts and virtual filesystems"],"tags":["filesystem","metadata","atime","missing-field"],"backgroundTag":"timestamp-not-available","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}