PureZIP library : ZIP / UNZIP files
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I simply use the ZLIB available functions, and AFAIK there is no function to handle multivolume archives.DataMiner wrote:@gnozal
Do you think there is a way to add multivolume-support?
Or, if not, do you have any idea to handle it by code?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi gnozal,
how I can check if an archive requires a password?
I make a small code like this.:
Is that the correct way to do ?
how I can check if an archive requires a password?
I make a small code like this.:
Code: Select all
x=PureZIP_FindFile(ZipFileName$(CurrentWindow),b$,#True)
PureZIP_GetFileInfo(ZipFileName$(CurrentWindow), x, @FileInfo.PureZIP_FileInfo)
; Passwort abfrage.
If FileInfo\flag = 9
pw$=InputRequester(Lang$(235), Lang$(236), "")
If pw$<>""
PureZIP_SetArchivePassword(pw$)
EndIf
EndIf
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
No, the help says :AL90 wrote:Hi gnozal,
how I can check if an archive requires a password?
I make a small code like this.:
Is that the correct way to do ?
So it should be something like that :Bit 0: If set, indicates that the file is encrypted.
Code: Select all
If FileInfo\flag & %1
IsCrypted = #True
Else
IsCrypted = #False
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hello gnozal!
I want to re-direct a bug to you that was found by "String" from the german PB forum.
He says that if he creates an archive with PureZIP and its filename contains sspeacial characters like äöüÄÖÜß, then this archiv is not caompatible with other pack-programs (WinRAR, 7-Zip) anymore.
Please, contact him for furthher informations, link to the german thread:
http://www.purebasic.fr/german/viewtopi ... highlight=
I want to re-direct a bug to you that was found by "String" from the german PB forum.
He says that if he creates an archive with PureZIP and its filename contains sspeacial characters like äöüÄÖÜß, then this archiv is not caompatible with other pack-programs (WinRAR, 7-Zip) anymore.
Please, contact him for furthher informations, link to the german thread:
http://www.purebasic.fr/german/viewtopi ... highlight=
PB 4.30
Code: Select all
onErrorGoto(?Fred)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
OkAND51 wrote:I want to re-direct a bug to you that was found by "String" from the german PB forum.
Please, contact him for furthher informations, link to the german thread:
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hallo gnozal
PureZIP kann lange Pfade packen.
Beim entpacken entstehen aber Fehler.
Hello gnozal
PureZIP can pack long paths.
However, faults arise unpack.
PureZIP kann lange Pfade packen.
Beim entpacken entstehen aber Fehler.
Hello gnozal
PureZIP can pack long paths.
However, faults arise unpack.
Code: Select all
; ####################
; There really are paths of this length
;File0.s = "C:\Dokumente und Einstellungen\Ich\Eigene Dateien\Eigene Musik\Future Trance Vol. 39\CD1\02 Everytime We Touch 2006.mp3"
; ####################
File1.s = "c:\Temp\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\OK_7777.txt"
File2.s = "c:\Temp\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\Error_7777.txt"
dir3.s = "c:\Temp\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\I am a path and no file\Super ERROR.txt"
If MakeSureDirectoryPathExists_(@File1)
If OpenFile(1,File1)
WriteString(1,"File1 OK")
CloseFile(1)
EndIf
If OpenFile(2,File2)
WriteString(2,"File2 Error")
CloseFile(2)
EndIf
If MakeSureDirectoryPathExists_(@dir3)
If OpenFile(2,dir3)
WriteString(2,"Dir Error")
CloseFile(2)
EndIf
EndIf
MyZIP.s = "C:\Temp\test.zip"
MyFilesToZIP.s = "c:\Temp\*.*"
MyZIPOutPut.s = "c:\Temp\ZIP_Extract\"
testZIP.l = PureZIP_AddFiles(MyZIP, MyFilesToZIP, #PureZIP_StorePathRelative, #PureZIP_Recursive)
If testZIP
PureZIP_ExtractFiles(MyZIP, "*.*", MyZIPOutPut, #True)
Debug "OK look in ´C:\Temp\ZIP_Extract\´"
Else
Debug "error"
EndIf
EndIf
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
No time to debug right now.String wrote:Hello gnozal
PureZIP can pack long paths.
However, faults arise unpack.
However, could you test http://freenet-homepage.de/gnozal/PureZIP_BETA.zip ? I changed one constant value ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Test codeString wrote:The problem exists also at the BETA.zip
PureZIP can pack a path with 254 signs.
But only one unpacking path length of 108.
Code: Select all
; Add files
MyZIP.s = "C:\temp\TestFile.zip"
Path.s = "c:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\Error_7777.jpg"
Debug PureZIP_AddFile(MyZIP.s, Path.s, #PureZIP_StorePathAbsolute)
Path.s = "c:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\Ok_7777.jpg"
Debug PureZIP_AddFile(MyZIP.s, Path.s, #PureZIP_StorePathAbsolute)
; Extract files
Path.s = "c:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777"
Debug PureZIP_ExtractFiles(MyZIP.s, "*.*", Path.s, #True)
Code: Select all
c:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\Error_7777.jpg
c:\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\TEMP\111111111111111\222222222222222\33333333333333333\444444444444444\555555555555\666666666\777777777777777777\Ok_7777.jpg
So it seems to work here ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
The PB3.94 library is not threadsafe nor unicode compatible.Tranquil wrote:I want to take a closer look on this lib. But I can not find any information if this lib is thread save and unicode able. Anything on this!?
The PB4.0x library exists in 4 versions :
- the standard version, located in %Purebasic%\PureLibraries\UserLibraries\ ;
- the thread-safe version, located in %Purebasic%\SubSystems\UserLibThreadSafe\PureLibraries\ .
- the unicode version, located in %Purebasic%\SubSystems\UserLibUnicode\PureLibraries\ .
- the unicode + thread-safe version, located in %Purebasic%\SubSystems\UserLibunicodeThreadSafe\PureLibraries\ .
In order to use this library in thread-safe mode (compiler option /THREAD), you have to enable the subsystem 'UserLibThreadSafe'
in the PB IDE, or add '/SUBSYSTEM UserLibThreadSafe' to the PBCompiler arguments. In jaPBe, do nothing : it will automatically
enable the 'UserLibThreadSafe' subsystem to use the threadsafe versions of the installed userlibraries.
It's the same logic for unicode and unicode + thread-safe modes.
I personally only use the standard version ; I did'nt get any feedback for the other versions, so I assume they work.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).