Closed JuniorJPDJ closed 3 years ago
:D
$ ./runtest.sh
Running ziprofs tests...
Mounting filesystem
--------------------------
Running test: zip is directory
PASS
--------------------------
Running test: tree
PASS
--------------------------
Running test: reading file content #1
PASS
--------------------------
Running test: reading file content #2
PASS
--------------------------
Running test: running script
PASS
Killing ziprofs
5/5 tests passed.
Funny, tests passed on my machine..
Ubuntu renamed fusepy's package from fuse to fusepy, arch have it like in upstream.
And don't use ZipFile's internal fields, including locks. It's never a good idea to rely on implementation details of a library that can change any time and break your code.
There's no reference in ZipExtFile back to ZipFile, and I don't feel like maintaining own reference list is a good idea, but that would be necessary to write this locks at my own. You see your point, but I don't feel like second way is good neither.
ATM I did pretty awful workaround, let's see what you will say about it :D
I've been reading ZipFile code and I'm certain that the way we are using it ZipExtFile will allways be seekable. It's only not seekable if you initialize ZipFile with a stream file-like object instead of a path like we do. So we can get rid of the manual position tracking and as a result custom ZipExtFile as well.
You are right, I was trying to tell it to you. FS will not work with non-seekable zip files, and the only case when ZipExtFile is non-seekable is non-seekable zip file.
This is no good, you can get in a situation where ziplock() will try to return lock of a ZipFile which got evicted from cache and destroyed.
Now reference to ZipFile
will be hold in ZipExtFile
so we are good I bet.
I'm removing custom ZipExtFile
and falling to pair of dicts - for ZipFile
and ZipExtFile
like you suggested.
Also gonna raise error when trying reads on non-seekable file.
Is it ok now? :D
Thanks for contributing, I added better example and merged it. Glad someone else found my small weekend project useful.
It's the best zip FS I used until today and I was looking at whole github and google ;) Just linked it in some places.
Fixed #2, fixes #3, resolves last issues from #1