PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Robert Rioja on January 25, 2016, 07:30:40 PM

Title: zlib
Post by: Robert Rioja on January 25, 2016, 07:30:40 PM
I need to use zlib or something like it to compress/decompress files.  But I do not want to use a dll.

Does anyone have anything similar to zlib but as a static library?

Or does anyone have Basic code to compress/decompress?

Thank you.
Title: Re: zlib
Post by: Eddy Van Esch on January 25, 2016, 07:36:55 PM
If it does not have to be compatible to the .zip format, search the PowerBASIC forums for "LZ78" en "LZSS". I'm pretty sure there is source code there to compress/decompress.

[added]
http://www.powerbasic.com/support/pbforums/showthread.php?t=23382&highlight=LZ78
http://www.powerbasic.com/support/pbforums/showthread.php?t=54472&highlight=LZSS
[\added]
Title: Re: zlib
Post by: Robert Rioja on January 25, 2016, 08:00:18 PM
Thank you Eddy.  That is exactly what I was looking for.
Title: Re: zlib
Post by: Rolf Brandt on February 16, 2016, 10:08:08 AM
I am using 7za.exe. Very easy to use. I attached a little project to backup FF3 Projects. I use it to backup different versions of my projects before I start messing with the code again.

Rolf
Title: Re: zlib
Post by: SeaVipe on February 18, 2016, 02:05:10 PM
If you don't need to zip files here is a batch file I use:



@echo off
REM /E copies directories, /Y suppresses overwrite prompt.
REM Convert the current time (with colons and a decimal)
REM to a string with hyphenated numbers (12-34-56-99):
set coln=%time%
set coln=%coln::=-%
set coln=%coln:.=-%
set coln=%coln: =0%
REM Copy to new dir with date-time designation:
xcopy /E /Y E:\SRC\VK3\*.* E:\SRC\BackUp\VK3\VK3bak.%date%-%coln%\
xcopy /E /Y c:\PROGRA~1\FreeBasic\inc\VMAC\*.* E:\SRC\BackUp\VK3\VK3bak.%date%-%coln%\inc\
xcopy /E /Y "E:\SRC\Help & Manual All Versions\Manual\VK3\*.*" E:\SRC\BackUp\VK3\VK3bak.%date%-%coln%\hm\
echo ============================================================================
xcopy /E /Y E:\SRC\VK3\*.* K:\BackUp\VK3\VK3bak.%date%-%coln%\
xcopy /E /Y c:\PROGRA~1\FreeBasic\inc\VMAC\*.* K:\BackUp\VK3\VK3bak.%date%-%coln%\inc\
xcopy /E /Y "E:\SRC\Help & Manual All Versions\Manual\VK3\*.*" K:\BackUp\VK3\VK3bak.%date%-%coln%\hm\
REM Done.
echo ============================================================================
echo Visual Keypad 3.0
echo Backup completed %date%-%coln%
pause



The above produces a folder something like "E:\SRC\BackUp\VK3\VK3bak.2016-02-18-11-35-59-12"
So if you ran the bat file twice in the same second you get 2 backups... -12 and maybe -50.
As you can see it simply copies everything to 2 different hard drives with no compression.
Each project has a similar batch file that is hard coded to the project with a link to the batch file on the "Tools" menu.
Also, I would wrap the path in double quotes not bothering to fiddle with a short folder name as in "C:\Program Files\..." not C:\PROGRA~1\...
I like the uncompressed backup as I can go into the backup folder quickly.


I hope you find this useful.
Title: Re: zlib
Post by: Robert Rioja on February 19, 2016, 04:11:51 PM
Thank you all for your help.  I am experimenting with all of your suggestions.
Robert