sxyazi/yazi · error · io::Error

trash item has no put-back name

Error message

trash item has no put-back name

What it means

Error "trash item has no put-back name" thrown in sxyazi/yazi.

Solutions

  1. No put-back name is recorded for this item; restore it manually from ~/.Trash instead.

When it happens

Trigger: Thrown at yazi-fs/src/trash/macos/ds_store.rs:46 when the library encounters an invalid state.

Common situations: Restoring a macOS trash item whose .DS_Store record lacks a put-back file name.


AI-assisted analysis of sxyazi/yazi@8ebf930f17 (2026-08-19). Data as JSON: /api/errors/e52e6566a9969234. Report an issue: GitHub.

Appendix: source

Thrown at yazi-fs/src/trash/macos/ds_store.rs:46

				b"ptbN" => location.name = Some(value.into()),
				_ => {}
			}
		}

		Ok(locations)
	}

	pub(super) fn join(&self, rel: &Path) -> io::Result<PathBuf> {
		if !rel.is_relative() || rel.has_parent_component() {
			return Err(io::Error::new(io::ErrorKind::InvalidInput, "invalid trash entry path"));
		}

		let parent = self.parent.as_deref().ok_or_else(|| {
			io::Error::new(io::ErrorKind::InvalidData, "trash item has no put-back location")
		})?;

		let name = self.name.as_deref().ok_or_else(|| {
			io::Error::new(io::ErrorKind::InvalidData, "trash item has no put-back name")
		})?;

		let mut components = Path::new(name).components();
		if !matches!(components.next(), Some(Component::Normal(_))) || components.next().is_some() {
			return Err(io::Error::new(io::ErrorKind::InvalidData, "invalid trash put-back name"));
		}

		let top_path = Path::new("/").join(parent).join(name);
		Ok(if rel.as_os_str().is_empty() { top_path } else { top_path.join(rel) })
	}
}

View on GitHub (pinned to 8ebf930f17)