{"record":{"id":"3efae4c281789768","repo":"sxyazi/yazi","slug":"ctime-not-available","errorCode":null,"errorMessage":"ctime not available","messagePattern":"ctime not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-fs/src/cha/cha.rs","lineNumber":194,"sourceCode":"\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}\n}\n","sourceCodeStart":176,"sourceCodeEnd":206,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-fs/src/cha/cha.rs#L176-L206","documentation":"Cha::ctime_dur converts the file's change time to a Duration since the Unix epoch and bails when ctime is None. ctime is normally populated on Unix, but some filesystems/API paths leave it unset, in which case the Option is None. Called by add_fields when emitting file metadata fields.","triggerScenarios":"Calling ctime_dur() (e.g. from add_fields) on a Cha whose ctime was never populated — typically platform-specific code paths where the underlying stat metadata did not include ctime.","commonSituations":"FUSE/virtual filesystems that report incomplete stat data; platform abstractions that return None for ctime; synthetic Cha values built manually without ctime.","solutions":["Check ctime availability (cha.ctime.is_some()) before calling and skip the field when None.","Fall back to mtime for change-time display.","Fix the platform metadata collection path so ctime gets populated."],"exampleFix":"// before\nfields.insert(\"ctime\", cha.ctime_dur()?.as_millis());\n// after\nif let Ok(ctime) = cha.ctime_dur() {\n    fields.insert(\"ctime\", ctime.as_millis());\n}","handlingStrategy":"fallback","validationCode":"if cha.ctime().is_none() { /* skip field or use mtime */ }","typeGuard":"fn has_ctime(cha: Cha) -> bool { cha.ctime().is_some() }","tryCatchPattern":"let ctime = cha.ctime_dur().ok().or_else(|| cha.mtime_dur().ok());","preventionTips":["Handle partial stat data from FUSE/virtual filesystems","Emit metadata fields independently so one missing value doesn't abort all fields","Verify the platform collection path populates ctime"],"tags":["filesystem","metadata","ctime","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"}