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

Building SquashFS using AddFile results in corrupted file #294

Open
SuperJMN opened this issue Apr 2, 2024 · 5 comments
Open

Building SquashFS using AddFile results in corrupted file #294

SuperJMN opened this issue Apr 2, 2024 · 5 comments

Comments

@SuperJMN
Copy link

SuperJMN commented Apr 2, 2024

Repro:

Run this code.

var builder = new DiscUtils.SquashFs.SquashFileSystemBuilder();
var f1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes("This is file 1."));
var f2 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes("This is file 2."));
builder.AddFile("1.txt", f1);
builder.AddFile("2.txt", f2);
builder.Build("TestDiscUtils.squashfs");

The resulting file cannot be open.

Using DiscUtils.SquashFs version 0.16.13 in Windows 11 x64.

Please, check this issue for more info: #56

LTRData added a commit to LTRData/DiscUtils that referenced this issue Apr 4, 2024
@LTRData
Copy link

LTRData commented Apr 5, 2024

I think I found why this happens and made a fix that seems to help, at least for simple tests like this. I am a bit unsure though and it probably needs more testing to verify.
LTRData@cc31cce

@SuperJMN
Copy link
Author

SuperJMN commented Apr 8, 2024

Wow, nice. I will take a look and see if it works. Thanks for your time, @LTRData !

@LTRData
Copy link

LTRData commented Apr 8, 2024

Wow, nice. I will take a look and see if it works. Thanks for your time, @LTRData !

If you want to use it as NuGet packages, my packages are prefixed LTRData. name such as LTRData.DiscUtils.SquashFs. There are some breaking changes compared to this repo, but typically easy to migrate to.

@SuperJMN
Copy link
Author

SuperJMN commented Apr 8, 2024

Wow, nice. I will take a look and see if it works. Thanks for your time, @LTRData !

If you want to use it as NuGet packages, my packages are prefixed LTRData. name such as LTRData.DiscUtils.SquashFs. There are some breaking changes compared to this repo, but typically easy to migrate to.

Thanks for the tip. Very much convient!

By the way, I've added a discussion I think it's worth taking into consideration #296.

Just in case you want to consdere something more: It would be awesome if you enabled issues/discussions in your fork, since your work started to differ from this repo, to bring consistency.

@LTRData
Copy link

LTRData commented Apr 8, 2024

Thanks for the suggestion! I have enabled issues and discussions there now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants