Page 1 of 1

UNZIP IN QB 45 BETA Source

Posted: Fri Jun 05, 2009 11:54 pm
by sonicbrit
Some people think you cant implement certain things in basic, I like to prove them wrong, this version doesn't use any assembler, only basic.

You'll need to edit the source to alter the input

change 'open "\sbunzip3.zip" for binary as #1' to change the filename (will eventually use command$ and alike)

and the output 'open "\" + f$ for binary as #2'

remove the "\" + to store in current folder (I did this so I wouldnt accidently overwrite my source when testing)

It only writes the first file, I'll be fixing that in the next release.

The main buffer string is only 24000 bytes long (it needs to be at least 32768 long). QB Strings are currently the issue, but I have ideas floating around my head and will play around with some ideas for tomorrow.

I will also implement the input and output buffers too, one of the other biggest slow downs since its reading/writing single bytes at a time.

I haven't put a license on it since zip is pretty public, but if you do use it somehow I wouldn't mind knowing about it. I do plan on finishing it and adding features that unzip has (like directories, attributes, file date/time etc..)

Enjoy the source, if you have any questions feel free to ask.

http://www.sonicbasic.com/sbunzip3.zip

Posted: Sat Jun 06, 2009 1:17 pm
by angros47
Great!

It works even in FB, with a little change (http://www.freebasic.net/forum/viewtopi ... 038#121038)
I could not believe that there was no unzip subroutine in QB, your work is really appreciated

Posted: Fri Jun 19, 2009 1:42 am
by sonicbrit
Should I finish this, or just let it go into obscurity?

Posted: Fri Jun 19, 2009 4:20 am
by angros47
Please finish it! It would be very useful: QB is very easy to read, so learning how zip works is easier from a sample in basic than from a sample in C

ATTN: sanjidao01

Posted: Sun Jul 26, 2009 6:11 am
by burger2227
Here is a little MORE helpful information!

Post QUESTIONS OR ANSWERS or GET LOST!

This is NOT a chat forum kiddo! :evil: