Welcome, Guest.
Please login or register.
Simple filesystem using compressed archives
Forum Login
Login Name: Create a new account
Password:     Forgot password

XBLite Forum    General Boards    Working Code Snippets  ›  Simple filesystem using compressed archives
Users Browsing Forum
No Members and 1 Guests

Simple filesystem using compressed archives  This thread currently has 7,937 views. Print Print Thread
1 Pages 1 Recommend Thread
26
September 8, 2008, 7:54am Report to Moderator Report to Moderator
Guest User
I am still working to (re)build my toolkit and i wrote a simple filesystem.It allow writting compressed/uncompressed files and reading files in compressed/uncompressed archives.

I noticed zlib example on http://www.xblite.com page has problems because functions are declared as CCALL functions and zlibwapi.dll functions are STDCALL functions, i had serious headaches before finding what was wrong.I inclued updated header file,lib and zlib 1.2.3 dll in the package.

It seems free of bugs but if you find some, mail me
The only problem is opening a file that is not in an archive is slow because zlib owns no function to find uncompressed file size.If someone finds a better solution than mine, i'll be happy.

This is extracted from readme.txt :

Quoted Text
This is a file simple file system that allows to mount archives in TAR/TAR.GZ format and read in them transparently
It is is totaly recursive so you can mount nested archives (russian dolls )
My first idea was to implement that with ZIP format but there are too much differents versions and compressions and
some ZIP programs create weird zip files.TAR/TAR.GZ if enough for me

It comes in 2 flavors : winapi & zlib version.

The winapi version allows TAR archives files mounting, linear reading and writting.
The zlib version allows TAR and TAR.GZ archives, .GZ files transparent reading (you read it same way you read a
non-compressed file) and compressed or linear writting.

TAR / TAR.GZ / GZ archive format is widely used ad there are a lot of tools to build thems.This is the one is use :
ALzip : http://www.altools.com/ALTools/ALZip.aspx



This post contains attachments; to download them you must login.

Logged
E-mail E-mail
Rhett Thompson
September 8, 2008, 12:36pm Report to Moderator Report to Moderator

Baby Member
Posts: 23
Hi,

You might want to check out the 7zip SDK.  I think it handles all of the discrepancies between different ZIP files, as well as support other compression algorithms(e.g. RAR, BZIP, etc.).  Anyhow, great work on this! I haven't found any bugs either
Logged Offline
Site Site Private Message Private message AIM AIM Windows Live Messenger WLM Reply: 1 - 5
26
September 14, 2008, 2:16pm Report to Moderator Report to Moderator
Guest User
Thanks Rhett, i took a look to 7zip Sdk, it is very interessant but will take time to adapt to XBlite because it is COM interface.I'll surely study it more in details after my current project.
I improved FS (slow open func fixed and added handler check w/ signature) and i will surely improve it more because it is used in my current project (a complete 2D game).I'll post it later with the project source
Logged
E-mail E-mail Reply: 2 - 5
17
September 19, 2008, 3:10am Report to Moderator Report to Moderator
Guest User
Hi Fano,

Rhett already suggested to handle a COM interface by:
1. writing function wrappers with c++ in a library (.dll)
2. exposing the wrappers' interface by declaring their prototypes extern "C"

I did not try it but Rhett might have.

Bye! Guy
Logged
E-mail E-mail Reply: 3 - 5
Rhett Thompson
September 19, 2008, 1:25pm Report to Moderator Report to Moderator

Baby Member
Posts: 23
Hi,

Guy is right is should be a fairly trivial thing to write a simple wrapper for the 7zip SDK.  Although I haven't written one for 7zip, I have for much more complex libraries (HGE and Irrlicht), and and the API does look simple.

The concept is simple enough:

You basically write a "constructor" wrapper function, around the actual constructor in C++ like:

Code
void*hge_Create(params...){

   return new hge(params...);

}


Then to access the methods of the object, you would write a wrapper for each method:

Code
void hge_setWindowSize(hge*hge, unsigned int width, unsigned int height){
   
   hge->setWindowSize(width, height);

}


Although the code does pile up after a bit, it works
Logged Offline
Site Site Private Message Private message AIM AIM Windows Live Messenger WLM Reply: 4 - 5
26
September 21, 2008, 9:46am Report to Moderator Report to Moderator
Guest User
Thanks for the tips, i think i'll look more further in 7zip because it seems a great library so i'll take some time to study it.
Logged
E-mail E-mail Reply: 5 - 5
1 Pages 1 Recommend Thread
Print Print Thread

XBLite Forum    General Boards    Working Code Snippets  ›  Simple filesystem using compressed archives

Thread Rating
There is currently no rating for this thread