zen-fs / zip

ZenFS Backend for zip files
https://zenfs.dev/zip/
MIT License
5 stars 3 forks source link

Failed to load zip file index #2

Closed neko-para closed 6 months ago

neko-para commented 7 months ago

resource.zip

image

After mounting this zip, readdir gave the following output

image

Seems that entries are flatten and not recognized properly.

msk4862 commented 7 months ago

Yes I'm also facing the same issue.

Sample code that I'm testing with:

import { configure, fs } from "@zenfs/core";
import { Zip } from "@zenfs/zip";

...

const res = await fetch("source_code.zip");
const data = await res.arrayBuffer();
await configure({
  home: { backend: Zip, zipData: data },
});

fs.readdir("/home/", function (err, list) {
  console.log(err, list);
});
Screenshot 2024-04-10 at 3 26 39 PM
james-pre commented 6 months ago

@neko-para @msk4862,

I apologize for not getting back to you sooner, I did not have the correct notification settings for this repository.

Unfortunately, I have no idea where this issue was introduced. If you have any ideas as to what is happening, I would greatly appreciate them.

In the mean time, I can start debugging and see what I come up with.

james-pre commented 6 months ago

@neko-para @msk4862,

The issue was with safeToString not slicing the buffer when useUTF8 was false. This has been fixed in v0.1.4. This fixes the issue on my end.

Has your issue been fixed?

neko-para commented 6 months ago

@neko-para @msk4862,

The issue was with safeToString not slicing the buffer when useUTF8 was false. This has been fixed in v0.1.4. This fixes the issue on my end.

Has your issue been fixed?

I'll try later, currently I've changed to using zip.js to explicitly extract and compress zip files.

james-pre commented 6 months ago

@neko-para Any updates on this?