Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting file from rar always results in reading 0 bytes #132

Open
Niedzwiedzw opened this issue Dec 8, 2024 · 10 comments · May be fixed by #133
Open

Extracting file from rar always results in reading 0 bytes #132

Niedzwiedzw opened this issue Dec 8, 2024 · 10 comments · May be fixed by #133

Comments

@Niedzwiedzw
Copy link

I'm listing the files first, the file is there, I'm rewinding the file just in case and uncompress_archive_file() reads 0 bytes anyway

@Niedzwiedzw
Copy link
Author

the same problem happens when using the cli from examples - extracting entire archive works fine but extracting single file just writes empty file

@otavio
Copy link
Member

otavio commented Dec 8, 2024

Do you have an archive that we can use as a sample to reproduce the issue?

@Niedzwiedzw
Copy link
Author

https://www.nexusmods.com/fallout4/mods/68485 you can download it without creating an account I think

@otavio
Copy link
Member

otavio commented Dec 8, 2024

Is it possible for you to create a small test case with that or put the file somewhere where I can download and test it directly?

@Niedzwiedzw
Copy link
Author

Niedzwiedzw commented Dec 8, 2024

I think it's copyrighted... but the test case is

cargo run --example uncompress_tool -- uncompress-archive-file Capital\ Wasteland\ Rock-It\ Launcher\ 1\ -\ Integrated-68485-1-1-1675554438.rar ./foo "Zanthir_RockItLauncher - Texture.BA2"

@Niedzwiedzw
Copy link
Author

I've tried reproducing it when I recreate a fresh archive (with 7z) and insert that same file under the same path it does not happen anymore... 7z handles the archive well though

@Niedzwiedzw
Copy link
Author

same error for a zip archive:

cargo run --example uncompress_tool -- uncompress-archive-file ./Creative\ Differences\ 3.1.2-13437-3-1-2-1716759989.zip ./foo "[CP] Rodney O'Brien/Assets/Items/Hats/PinkSummerHat.png"

https://www.nexusmods.com/stardewvalley/mods/13437

@Niedzwiedzw
Copy link
Author

Niedzwiedzw commented Dec 29, 2024

bsdtar -xvf ../Creative\ Differences\ 3.1.2-13437-3-1-2-1716759989.zip "\[CP\] Rodney O'Brien/Assets/Items/Hats/PinkSummerHat.png"

this works (not sure why I have to escape the '[' bracket, without it it fails)

@Niedzwiedzw
Copy link
Author

Niedzwiedzw commented Dec 29, 2024

other files in that archive work fine

cargo run --example uncompress_tool -- uncompress-archive-file ./dupa/Creative\ Differences\ 3.1.2-13437-3-1-2-1716759989.zip ./foo "[CP] Rodney O'Brien/Assets/Items/Hats/EggHat.png"

@Niedzwiedzw
Copy link
Author

#129

could it be related to this?

@Niedzwiedzw Niedzwiedzw linked a pull request Dec 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants