UNZIP IN QB 45 BETA Source

Announce and discuss the progress of your various programming-related projects...programs, games, websites, tutorials, libraries...anything!

Moderators: Pete, Mods

Post Reply
sonicbrit
Newbie
Posts: 4
Joined: Fri Jun 05, 2009 5:22 pm

UNZIP IN QB 45 BETA Source

Post 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
angros47
Veteran
Posts: 79
Joined: Mon Sep 08, 2008 12:52 pm
Contact:

Post 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
sonicbrit
Newbie
Posts: 4
Joined: Fri Jun 05, 2009 5:22 pm

Post by sonicbrit »

Should I finish this, or just let it go into obscurity?
angros47
Veteran
Posts: 79
Joined: Mon Sep 08, 2008 12:52 pm
Contact:

Post 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
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

ATTN: sanjidao01

Post by burger2227 »

Here is a little MORE helpful information!

Post QUESTIONS OR ANSWERS or GET LOST!

This is NOT a chat forum kiddo! :evil:
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply