Oh thats nice! from the looks of it, its possible to create a index from packages which means I could then integrate it with the filesystem not just the cache.
My goal is to make a package that mimics filesystem without Write or rather when you write it writes on disk in the same location.
so if I ScanDir in “Scripts/” and I have “Scripts/OnDisk.lua” in the hdd and then “Scripts/InPkg.lua” in the PKG, the ScanDir function should return both files.
However if I write to “Scripts/InPkg.lua” that will create a file on the actual filesystem ( hdd ) and not the pkg, but when I then run ScanDir I will still have two files and the one in PKG will be ignored.
The filesystem will prefer the InPkg.lua from the filesystem instead of the pkg.
Although I will probably want to give some control to the priority list such that I can prefer one package over the other or in some instances prefer pkg over filesystem.
The benefit of this would be that players can exchange mods in .pkg format and easily remove or add them without the need to unzip anything and that my filesystem controls remain the same. Even if I try to write to a file thats in the pkg it will just write it to the hdd and therefore “overwrite” it as far as priority is concerned. Therefore making somewhat of a virtual extension to the filesystem.
I previously worked on Love2D ( which uses PhysicsFS ) before moving to Urho3D, One key issue with PhysicsFS is that it applies strict limitations making something like a file browser next to impossible to do. If you are making a editor for example or something that needs to access files on disk it will be a pain since you might need to write all the operations yourself for each OS.
I think the way the package system is now its possible to create the behaviour I need, so I will have a ago.