DiscUtils
DiscUtils copied to clipboard
Building SquashFS using AddFile results in corrupted file
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: https://github.com/DiscUtils/DiscUtils/issues/56
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. https://github.com/LTRData/DiscUtils/commit/cc31cce1b9706ff1a179512223948cd95b8a8bfb
Wow, nice. I will take a look and see if it works. Thanks for your time, @LTRData !
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.
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 asLTRData.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 https://github.com/DiscUtils/DiscUtils/discussions/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.
Thanks for the suggestion! I have enabled issues and discussions there now!