From 718a207ab3c8eb73948b8acbd9ab6e79585628a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bardon?= Date: Sun, 19 Apr 2026 20:36:19 +0200 Subject: [PATCH] Add `Entry::set_path_bytes` This allows mapping paths when unpacking an archive. --- src/entry.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/entry.rs b/src/entry.rs index fbc2efb9..3a90fadd 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -88,6 +88,14 @@ impl<'a, R: Read> Entry<'a, R> { self.fields.path_bytes() } + /// Sets the raw bytes listed for this entry. + /// + /// Subsequent calls to [`path_bytes`][Self::path_bytes] will return the + /// provided value. + pub fn set_path_bytes(&mut self, path_bytes: Vec) { + self.fields.long_pathname = Some(path_bytes); + } + /// Returns the link name for this entry, if any is found. /// /// This method may fail if the pathname is not valid Unicode and this is