No, this is not supported.zxtunes.com wrote:gnozal tell PureZip supports unpacking zip (RAW) archive without heading from memory
(1 file without zip a heading format)?
PureZIP library : ZIP / UNZIP files
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureZIP library : ZIP / UNZIP files [password supported]
With PB 4.41
C:\toto is the main directory
repfic = c:\toto\titi
PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)
It's impossible to read archive after
ex:I don't arrive to store the relative path
C:\toto is the main directory
repfic = c:\toto\titi
PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)
PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_RecursiveZeroDirs)if i use
It's impossible to read archive after
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
2KiKI : I am getting the expected results here ...
Debug : 1
Resulting archive C:\TEST1.ZIP : valid [tested with TotalCMD, 7-ZIP and WinRAR]
Archive listing : c:\TEST1.ZIP\banque.dbDebug : 1
Resulting archive C:\TEST2.ZIP : valid [tested with TotalCMD, 7-ZIP and WinRAR]
Archive listing : c:\TEST2.ZIP\banque.db
Your base directory is "C:\toto\titi", so if you choose #PureZIP_StorePathRelative, the paths are stored relative to it, i.e. no path stored for 'banque.db' (it's in the base directory).
Try this :
NB : if you want more control, you may use the PureZIP_Archive_*() functions.
Code: Select all
repfic.s = "C:\toto\titi"
MyZIP.s = "C:\TEST1.ZIP"
Debug PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)
Resulting archive C:\TEST1.ZIP : valid [tested with TotalCMD, 7-ZIP and WinRAR]
Archive listing : c:\TEST1.ZIP\banque.db
Code: Select all
repfic.s = "C:\toto\titi"
MyZIP.s = "C:\TEST2.ZIP"
Debug PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_RecursiveZeroDirs)
Resulting archive C:\TEST2.ZIP : valid [tested with TotalCMD, 7-ZIP and WinRAR]
Archive listing : c:\TEST2.ZIP\banque.db
Your base directory is "C:\toto\titi", so if you choose #PureZIP_StorePathRelative, the paths are stored relative to it, i.e. no path stored for 'banque.db' (it's in the base directory).
Try this :
Code: Select all
repfic.s = "C:\toto"
Debug PureZIP_AddFiles(MyZIP, repfic+"\*.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureZIP library : ZIP / UNZIP files [password supported]
Hello Gnozal,
what does a Result of -666 means for function PureZIP_Archive_Compress() ?
(sorry no example code this time)
Kind Regards, Kurzer
what does a Result of -666 means for function PureZIP_Archive_Compress() ?
(sorry no example code this time)
Kind Regards, Kurzer
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
-666 is #PureZIP_CallbackStop.kurzer wrote:what does a Result of -666 means for function PureZIP_Archive_Compress() ?
(sorry no example code this time)
PureZIP_SetCompressionCallback(*ProcedureAddress)
The callback is called in realtime during compression or decompression.
Procedure MyCallback(FileName.s, Progression.f, UserParam.l)
; FileName : current processed file (if applicable)
; Progression : progression percentage)
ProcedureReturn #False
; ProcedureReturn #True to stop the compression
EndProcedure
Returned value [only for PureZIP_Archive_Compress() and PureZIP_Archive_Extract()]
#FALSE : compression / extraction continues
#TRUE : compression / extraction stops !
PureZIP_Archive_Compress() and PureZIP_Archive_Extract() returns #PureZIP_CallbackStop error
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureZIP library : ZIP / UNZIP files [password supported]
Uhh damn, thank you for this hint!
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
Hi Gnozal
PB 4.40 x86 WinXP SP3
Can you spare some time to help me?
Using three simple Pure_Zip functions I create an archive with just one file inside (that is all I need):
PureZIP_Archive_Create(sMyZipFilePathFull, #APPEND_STATUS_CREATE)
PureZIP_AddFile(sMyZipFilePathFull, sMyFilePathFull, #PureZIP_StorePathAbsolute)
PureZIP_Archive_Close()
A zip file is created (archived file size is correct, 1,219,434 bytes) and I can open it with WinZip, WinRar etc but I cannot extract the file.
WinZip reports:
Extracting file: C:\Temp\Leg2-Small.zip
Extracting to "C:\Temp\"
Use Path: yes Overlay Files: no
Error in file #1: bad Zip file offset (Error local header signature not found): disk #1 offset: 0
WinRar:
! C:\Temp\Leg2-Small.zip: The archive is corrupt
PureZIP_ExtractFiles(sMyZipFilePathFull, "*.*", "C:\Temp", #TRUE) does not work either.
This is the same with or without storing the file path, thread safe mode or not. What am I doing wrong?
PB 4.40 x86 WinXP SP3
Can you spare some time to help me?
Using three simple Pure_Zip functions I create an archive with just one file inside (that is all I need):
PureZIP_Archive_Create(sMyZipFilePathFull, #APPEND_STATUS_CREATE)
PureZIP_AddFile(sMyZipFilePathFull, sMyFilePathFull, #PureZIP_StorePathAbsolute)
PureZIP_Archive_Close()
A zip file is created (archived file size is correct, 1,219,434 bytes) and I can open it with WinZip, WinRar etc but I cannot extract the file.
WinZip reports:
Extracting file: C:\Temp\Leg2-Small.zip
Extracting to "C:\Temp\"
Use Path: yes Overlay Files: no
Error in file #1: bad Zip file offset (Error local header signature not found): disk #1 offset: 0
WinRar:
! C:\Temp\Leg2-Small.zip: The archive is corrupt
PureZIP_ExtractFiles(sMyZipFilePathFull, "*.*", "C:\Temp", #TRUE) does not work either.
This is the same with or without storing the file path, thread safe mode or not. What am I doing wrong?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
You can't mix PureZIP_Archive_*() functions with 'standalone' functions like PureZIP_AddFile().IdeasVacuum wrote:Using three simple Pure_Zip functions I create an archive with just one file inside (that is all I need):
PureZIP_Archive_Create(sMyZipFilePathFull, #APPEND_STATUS_CREATE)
PureZIP_AddFile(sMyZipFilePathFull, sMyFilePathFull, #PureZIP_StorePathAbsolute)
PureZIP_Archive_Close()
A zip file is created (archived file size is correct, 1,219,434 bytes) and I can open it with WinZip, WinRar etc but I cannot extract the file.
If you use PureZIP_Archive_Create(), you have to use PureZIP_Archive_Compress().
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- Always Here
- Posts: 6425
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
Owch! So obvious with hindsight! Sorry to waste your time. It's a magnificent library, thank you.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
I have updated the help fileIdeasVacuum wrote:Owch! So obvious with hindsight!
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- DoubleDutch
- Addict
- Posts: 3219
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
On PureBasic v4.50b2 there is a strange error:
Gives error: Can't write numerical value into a string variable.
But if I the structure as:
It works.
Code: Select all
filename$=myFileinfo\FileName
But if I the structure as:
Code: Select all
Structure PureZIP_FileInfo2
Version.l ; version made by
VersionNeeded.l ; version needed to extract
flag.l ; general purpose bit flag [if bit 0 is set the file is encrypted]
CompressionMethod.l ; compression method [0 - 10]
dosDate.l ; last mod file date in Dos format [do not use !]
Crc32.l ; crc-32
CompressedSize.l ; compressed size
unCompressedSize.l ; uncompressed size
SizeFilename.l ; filename length
SizeFileExtra.l ; extra field length
SizeFileComment.l ; file comment length
DiskNumStart.l ; disk number start
internal_fa.l ; internal file attributes
external_fa.l ; external file attributes (packed file attributes)
tmu_date.tm_date ; file date (see tm_date structure) [use this to get filedate!]
FileName.s ; filename
EndStructure
myFileinfo.PureZIP_FileInfo2
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: PureZIP library : ZIP / UNZIP files [password supported]
I've noticed the same thing as Double Dutch with 4.5b2. uninstall/reinstall of the userlib does not fix. somehow the structure definition is truncated.
(I made a post in the userlib thread, which turned out to be the wrong place!)
(I made a post in the userlib thread, which turned out to be the wrong place!)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
I can't download PB4.50 right now, but iirc the structure is defined in PureZIP.res, so I suspect the new PB version doesn't read old residents correctly anymore ?DoubleDutch wrote:On PureBasic v4.50b2 there is a strange error:Gives error: Can't write numerical value into a string variable.[/code]Code: Select all
filename$=myFileinfo\FileName
I will probably have to recompile the resident(s).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureZIP library : ZIP / UNZIP files [password supported]
id liek to ask for a file delete function, cuz if i do "AddFile" and the zip contains that file it just places it near the old item, produces 2 files with same name in the archive.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureZIP library : ZIP / UNZIP files [password supported]
ZLIB does not provide any function to delete a file in an archive.dmxpowa wrote:id liek to ask for a file delete function, cuz if i do "AddFile" and the zip contains that file it just places it near the old item, produces 2 files with same name in the archive.
So this will not happen any time soon.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).