{"record":{"id":"72fb88aa277f074e","repo":"sxyazi/yazi","slug":"trash-directory-is-not-empty","errorCode":null,"errorMessage":"trash directory is not empty","messagePattern":"trash directory is not empty","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/windows/trash.rs","lineNumber":92,"sourceCode":"\t\tlet cha = if let Some(entry) = entry {\n\t\t\tTrashSig::item(&self.resolve(entry)?)?\n\t\t} else {\n\t\t\tTrashSig::root()?\n\t\t};\n\n\t\tOk(if cha.hits(current.cha) { None } else { Some(File { cha, ..current.clone() }) })\n\t}\n\n\tpub(crate) fn remove_file(&self, entry: &TrashEntry) -> io::Result<()> {\n\t\tself.resolve(entry)?.delete()\n\t}\n\n\tpub(crate) fn remove_dir(&self, entry: &TrashEntry) -> io::Result<()> {\n\t\tlet item = self.resolve(entry)?;\n\t\tif !entry.has_rel() {\n\t\t\titem.delete()\n\t\t} else if !item.is_empty()? {\n\t\t\tErr(io::Error::new(io::ErrorKind::DirectoryNotEmpty, \"trash directory is not empty\"))\n\t\t} else {\n\t\t\titem.delete()\n\t\t}\n\t}\n\n\tpub(crate) fn restore(&self, entries: TrashEntries) -> io::Result<()> {\n\t\tfor entry in entries {\n\t\t\tlet to = entry.original.as_deref().ok_or_else(|| {\n\t\t\t\tio::Error::new(io::ErrorKind::NotFound, \"trash item has no put-back location\")\n\t\t\t})?;\n\n\t\t\tself.restore_do(&self.resolve(&entry)?, to)?;\n\t\t}\n\t\tOk(())\n\t}\n\n\tpub(crate) fn rename(&self, entry: &TrashEntry, path: &Path) -> io::Result<()> {\n\t\tfs::rename(&entry.backing, path)","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/sxyazi/yazi/blob/a541adde4e5b082719a0f21a87eb3eab071ece58/yazi-fs/src/trash/windows/trash.rs#L74-L110","documentation":"Error \"trash directory is not empty\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/trash/windows/trash.rs:91 when the library encounters an invalid state.","commonSituations":"Deleting a trash directory that still contains items, refusing a non-empty removal.","solutions":["The trash directory still contains items; empty it or resolve the conflicting entries before this operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a541adde4e5b082719a0f21a87eb3eab071ece58","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}