sxyazi/yazi · error · io::Error

invalid trash put-back name

Error message

invalid trash put-back name

What it means

Error "invalid trash put-back name" thrown in sxyazi/yazi.

Solutions

  1. The recorded put-back name is invalid; restore the item manually from ~/.Trash.

When it happens

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

Common situations: Decoding a put-back name from .DS_Store that is not a valid file name.


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

Appendix: source

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

		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)