{"record":{"id":"fb2d50d60fb162fa","repo":"sxyazi/yazi","slug":"btime-not-available","errorCode":null,"errorMessage":"btime not available","messagePattern":"btime not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-fs/src/cha/cha.rs","lineNumber":186,"sourceCode":"\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}\n\n\tpub fn mtime_dur(self) -> anyhow::Result<Duration> {\n\t\tif let Some(mtime) = self.mtime {\n\t\t\tOk(mtime.duration_since(UNIX_EPOCH)?)\n\t\t} else {\n\t\t\tbail!(\"mtime not available\");\n\t\t}\n\t}","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-fs/src/cha/cha.rs#L168-L204","documentation":"Cha::btime_dur converts the file's birth (creation) time to a Duration since the Unix epoch and bails when btime is None. Birth time is only reported on some platforms (macOS, Windows, recent Linux via statx), so on others it is always None. Callers include add_fields and hash_u128 which build extra file fields.","triggerScenarios":"Calling btime_dur() (directly or via add_fields/hash_u128) on a Cha from a platform/filesystem that does not expose creation time — e.g. Linux stat() without statx, ext4 without crtime, NFS.","commonSituations":"Running a btime-dependent feature (like displaying 'Created' column) on Linux filesystems that don't report crtime; older kernels lacking statx support.","solutions":["Guard with cha.btime.is_some() (or btime()) and omit/hide the creation-time field when absent.","Fall back to ctime or mtime as an approximation when btime is missing.","On Linux, ensure the code path uses statx where available to actually populate btime."],"exampleFix":"// before\nfields.insert(\"btime\", cha.btime_dur()?.as_millis());\n// after\nif let Ok(btime) = cha.btime_dur() {\n    fields.insert(\"btime\", btime.as_millis());\n}","handlingStrategy":"fallback","validationCode":"if cha.btime().is_none() { /* omit or fall back */ }","typeGuard":"fn has_btime(cha: Cha) -> bool { cha.btime().is_some() }","tryCatchPattern":"let btime = cha.btime_dur().ok(); // None on platforms without birth time\nif let Some(b) = btime { /* emit field */ }","preventionTips":["Gate creation-time UI/features on platform capability","On Linux use statx to actually obtain btime where supported","Provide mtime/ctime fallbacks for display purposes"],"tags":["filesystem","metadata","btime","platform-specific","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"}