It is currently Wed May 22, 2013 9:28 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 593 posts ]  Go to page Previous  1 ... 33, 34, 35, 36, 37, 38, 39, 40  Next
Author Message
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Mon Dec 21, 2009 1:27 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
zxtunes.com wrote:
gnozal tell PureZip supports unpacking zip (RAW) archive without heading from memory
(1 file without zip a heading format)?

No, this is not supported.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Feb 02, 2010 11:49 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 28, 2006 11:49 am
Posts: 145
Location: FRANCE
With PB 4.41
Quote:
I don't arrive to store the relative path
ex:
C:\toto is the main directory
repfic = c:\toto\titi
PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)

Quote:
if i use

PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_RecursiveZeroDirs)
It's impossible to read archive after


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Feb 02, 2010 1:23 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
2KiKI : I am getting the expected results here ...

Code:
repfic.s = "C:\toto\titi"
MyZIP.s = "C:\TEST1.ZIP"
Debug PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)

Debug : 1
Resulting archive C:\TEST1.ZIP : valid [tested with TotalCMD, 7-ZIP and WinRAR]
Archive listing : c:\TEST1.ZIP\banque.db
Code:
repfic.s = "C:\toto\titi"
MyZIP.s = "C:\TEST2.ZIP"
Debug PureZIP_AddFiles(MyZIP, repfic+"\banque.db", #PureZIP_StorePathRelative, #PureZIP_RecursiveZeroDirs)
Debug : 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 :
Code:
repfic.s = "C:\toto"
Debug PureZIP_AddFiles(MyZIP, repfic+"\*.db", #PureZIP_StorePathRelative, #PureZIP_Recursive)

NB : if you want more control, you may use the PureZIP_Archive_*() functions.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Feb 09, 2010 3:09 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 227
Location: I live in "Bratwurst" land ;-)
Hello Gnozal,

what does a Result of -666 means for function PureZIP_Archive_Compress() ?
(sorry no example code this time)

Kind Regards, Kurzer

_________________
Image


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Feb 09, 2010 3:21 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
kurzer wrote:
what does a Result of -666 means for function PureZIP_Archive_Compress() ?
(sorry no example code this time)
-666 is #PureZIP_CallbackStop.
Quote:
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).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Feb 09, 2010 4:01 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 227
Location: I live in "Bratwurst" land ;-)
Uhh damn, thank you for this hint! :shock:

_________________
Image


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Wed Feb 17, 2010 8:16 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
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?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Thu Feb 18, 2010 9:48 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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.
You can't mix PureZIP_Archive_*() functions with 'standalone' functions like PureZIP_AddFile().
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).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Thu Feb 18, 2010 5:49 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
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.


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Fri Feb 19, 2010 9:52 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
IdeasVacuum wrote:
Owch! So obvious with hindsight!

I have updated the help file :wink:

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Fri Apr 02, 2010 11:44 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
On PureBasic v4.50b2 there is a strange error:

Code:
filename$=myFileinfo\FileName
Gives error: Can't write numerical value into a string variable.

But if I the structure as:

Code:
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

It works.

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Tue Apr 06, 2010 10:41 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 15, 2010 2:03 pm
Posts: 144
Location: Triad, NC
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!)

_________________
-Jon

Fedora user
But I work with Win7


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Wed Apr 07, 2010 12:38 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
DoubleDutch wrote:
On PureBasic v4.50b2 there is a strange error:
Code:
filename$=myFileinfo\FileName
Gives error: Can't write numerical value into a string variable.[/code]
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 ?
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).


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Wed Apr 21, 2010 5:34 am 
Offline
New User
New User

Joined: Thu Jul 16, 2009 1:02 pm
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: PureZIP library : ZIP / UNZIP files [password supported]
PostPosted: Thu Apr 22, 2010 2:24 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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.
ZLIB does not provide any function to delete a file in an 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).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 593 posts ]  Go to page Previous  1 ... 33, 34, 35, 36, 37, 38, 39, 40  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye