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.
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]
Thank you Eddy. That is exactly what I was looking for.
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
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.
Thank you all for your help. I am experimenting with all of your suggestions.
Robert