<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — gman.ZipEngine]]></title>
		<link>https://gprogs.com/index.php</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;fid=8&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent topics at GMan's Mods & Stuff.]]></description>
		<lastBuildDate>Fri, 01 Jan 2016 10:08:23 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[ZipEngine and BMX 64 Bit?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=487&amp;action=new</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Fri, 01 Jan 2016 10:08:23 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=487&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Support for CRX (Chrome Extension Files)]]></title>
			<link>https://gprogs.com/viewtopic.php?id=471&amp;action=new</link>
			<description><![CDATA[<p>Hi there, </p><p>the method ScanCentralHeader of Type TZipFileList can be changed to the following code (or similar), in order to make extraction of CRX (Chrome Extension Files) possible via zipengine.</p><div class="codebox"><pre><code>    

    Rem
        bbdoc: Scans the central header for files.  Returns true if successful.
    End Rem
    Method ScanCentralHeader:Int()
    
        SeekStream(zipFile, 0)
        Local magic_number:Int = ReadInt(zipFile);
        Local zip_start_pos:Int = 0;
        
        &#039; CRX FILE (Google Chrome Extension File), see: http://developer.chrome.com/extensions/crx.html
        If magic_number = $34327243 Then
            
            zip_start_pos:+4;
            
            ReadInt(zipFile); &#039; CRX Version
            zip_start_pos:+4;
            
            zip_start_pos:+ReadInt(zipFile); &#039; length of crx public key
            zip_start_pos:+4;
            
            zip_start_pos:+ReadInt(zipFile); &#039; length of crx signature
            zip_start_pos:+4;
            
            SeekStream(zipFile, zip_start_pos);
            magic_number:Int = ReadInt(zipFile);
            
        EndIf
        
        &#039; first check to see if its even a valid ZIP file
        If magic_number &lt;&gt; $04034b50 Then 
            DebugLog(&quot;Invalid ZIP file!&quot;)
            Return False
        EndIf
        
        Local header_start:Int = 0
        
        &#039; jump to the end
        SeekStream(zipFile, StreamSize(zipFile) - 4)
        
        &#039; seek the end central directory structure
        While Not StreamPos(zipFile) = 0
            Local sig:Int = ReadInt(zipFile)
            If sig = $06054b50 Then
                &#039; jump to start of central dir location    
                SeekStream(zipFile, StreamPos(zipFile) + 12)
                header_start = ReadInt(zipFile)
                Exit                
            Else
                &#039; rewind 3 bytes and try again
                SeekStream(zipFile, StreamPos(zipFile) - 5)
            EndIf
        EndWhile
    
        &#039; if we found the header, then process
        If Not header_start Then 
            DebugLog(&quot;unable to locate central directory!&quot;)
            Return False
        EndIf
        
        header_start:+zip_start_pos;
        
        &#039; seek to the start of the central directory
        SeekStream(zipFile, header_start)
        
        While True And Not Eof(zipFile)
            Local entry:SZipFileEntry = SZipFileEntry.Create()
            If entry.header.fill(zipFile) Then
                FileList.AddLast(entry)

                &#039; read filename
                entry.zipFileName = entry.header.FileName            
                extractFilename(entry)                                 
            Else
                Exit
            EndIf
        EndWhile
    
        Return True
    EndMethod</code></pre></div><p><img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (paramausi)]]></author>
			<pubDate>Wed, 13 Feb 2013 15:41:48 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=471&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[zwObject.RemoveFile()?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=467&amp;action=new</link>
			<description><![CDATA[<p>Hi!</p><p>What&#039;s the best way to remove a certain file from multiple zip files (1000+) without having to recreate them manually each time?</p><p>A command like &quot;zwObject.RemoveFile(filename)&quot; would be quite helpful here.</p><p>Grisu</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Sun, 19 Aug 2012 09:13:14 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=467&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[v2.15 - undefined reference again... :)]]></title>
			<link>https://gprogs.com/viewtopic.php?id=459&amp;action=new</link>
			<description><![CDATA[<p>Hi there!</p><p>Thanks for updating this great module. </p><p>Sadly, I get a similar error message with your latest release:<br />Linking:prp044_04_zombie_bunny_fin.exe<br />C:/BlitzMax/mod/gman.mod/zipengine.mod/zipengine.release.win32.x86.a(zipengine.bmx.release.win32.x86.o):(code+0x670): undefined reference to `zipWriteInFileInZipUTF8&#039;<br />C:/BlitzMax/mod/gman.mod/zipengine.mod/zipengine.release.win32.x86.a(zipengine.bmx.release.win32.x86.o):(code+0x98a): undefined reference to `zipWriteInFileInZipUTF8&#039;</p><p>Can you fix this issue too?</p><p>Grisu</p><p>P.S.: OS: Win7 (64 Bit) with BMX 1.48, MinGW 4.6.1 and FASM 1.70.</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Fri, 20 Apr 2012 20:05:32 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=459&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[ZipRamStream.ZCreate fails with size=0]]></title>
			<link>https://gprogs.com/viewtopic.php?id=440&amp;action=new</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (plash)]]></author>
			<pubDate>Fri, 13 May 2011 18:55:28 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=440&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Unicode streams]]></title>
			<link>https://gprogs.com/viewtopic.php?id=437&amp;action=new</link>
			<description><![CDATA[]]></description>
			<author><![CDATA[null@example.com (siread)]]></author>
			<pubDate>Wed, 13 Apr 2011 09:00:04 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=437&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[error: storage size of 'tm_buf' isn't known]]></title>
			<link>https://gprogs.com/viewtopic.php?id=424&amp;action=new</link>
			<description><![CDATA[<p>is this a common thing or am I doing something wrong?</p>]]></description>
			<author><![CDATA[null@example.com (EdzUp)]]></author>
			<pubDate>Thu, 29 Jul 2010 20:46:44 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=424&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[v2.11 - Undefined reference?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=422&amp;action=new</link>
			<description><![CDATA[<p>Hi</p><p>With bmx 1.40 (win7, 64 Bit) I&#039;m getting an error when I try to recompile the new module:<br />/BlitzMax/mod/gman.mod/zipengine.mod/zipengine.release.win32.x86.a(zipengine.bmx.release.win32.x86.o): undefined reference to `bmx_fill_fopen_filefunc&#039;</p><p>v2.10 works fine though?!</p><p>Grisu</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Sat, 24 Jul 2010 23:46:52 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=422&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[zrObject.ExtractFileToDisk - Unhandled Exception]]></title>
			<link>https://gprogs.com/viewtopic.php?id=421&amp;action=new</link>
			<description><![CDATA[<div class="codebox"><pre><code>Function Extract_Zip()

      Local zrObject:ZipReader = New ZipReader
      Local Extracted_file:String
      Local Scr_file:String 

      SetGadgetText(Curr_Msg_Lab,&quot;Extracting File: &quot;)
    
      If ( zrObject.OpenZip(ServerZIPFile) ) Then

      For Local i:Int=1 To zrObject.getFileCount()-1
                 Scr_file:String=zrObject.getFileInfo(i).zipFileName  
                 Extracted_file=Replace(Scr_file,&quot;Pocket Radio Player/&quot;,&quot;&quot;)

           If Extracted_file.find(&quot;.&quot;)&gt;0 Then zrObject.ExtractFileToDisk(Scr_file, Extracted_file, True) &lt;- This one!!

         Next

        zrObject.CloseZip()
    End If
        
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Sat, 24 Jul 2010 23:05:22 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=421&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Directory structure]]></title>
			<link>https://gprogs.com/viewtopic.php?id=420&amp;action=new</link>
			<description><![CDATA[<p>Hi,</p><p>I wrote a function that creates the needed directory structure and extracts all files in a zip.<br />Now i want to add a complete directory, including subdirectorys, to a new empty zip.</p><p>But, how do i create a directory structure inside a new empty zip?</p>]]></description>
			<author><![CDATA[null@example.com (Ferret)]]></author>
			<pubDate>Wed, 30 Jun 2010 14:16:56 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=420&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[ZipEngine and incbin]]></title>
			<link>https://gprogs.com/viewtopic.php?id=410&amp;action=new</link>
			<description><![CDATA[<p>Hello, should it be possible to open a zip that is incbinned?</p><p>ei., zip.OpenZip(&quot;incbin::myzip.zip&quot;)</p><p>Doesn&#039;t seem to be working, so I guess the next question is, can it be make to work if not? <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (peterigz)]]></author>
			<pubDate>Fri, 12 Mar 2010 00:54:23 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=410&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Addfile: Change source and destination dir+filename?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=383&amp;action=new</link>
			<description><![CDATA[<p>Hello!</p><p>Is it possible to change the source and destination dir+filename when creating a zip?</p><p>Somewhat like that:</p><p>zwObject.OpenZip(&quot;testfile.zip&quot;, False) )<br />zwObject.AddFile(&quot;Source\station.txt&quot;, &quot;ZipDir\stationzip.txt, password)<br />zwObject.CloseZip()</p><p>Thanks.<br />Grisu</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Tue, 18 Aug 2009 21:50:38 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=383&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Bug: ZIPE not freeing up memory / closing stream after usage?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=382&amp;action=new</link>
			<description><![CDATA[<p>Hi!</p><p>In my &quot;Pocket Radio Player&quot; I have a memory leak when I use the stream functions of your module a lot.<br />It also seems that the zip file is still &quot;locked&quot;, even when I already have opened another one.</p><p>Example line:<br />ButtoIco_stop:TIconstrip=LoadIconStrip(&quot;zipe::skins\&quot;+filename+&quot;::prp_stop.png&quot;)</p><p>Is there a way to force the wrapper to close the stream / zip file and free the memory allocated?<br />The bmx Garbage Collector doesn&#039;t help here at all.</p><p>Thanks.</p><p>Grisu</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Tue, 18 Aug 2009 18:11:50 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=382&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[gman]]></title>
			<link>https://gprogs.com/viewtopic.php?id=381&amp;action=new</link>
			<description><![CDATA[<p>do you have any simple code for ading a dir to a zip keeping the file structure as i have tried to play about with it but im not getting to far here is my code so far</p><div class="codebox"><pre><code>SuperStrict

Import maxGui.Drivers
Import gman.zipengine

Local myStyle:Int                            = WINDOW_TITLEBAR | WINDOW_STATUS | WINDOW_CLIENTCOORDS 
Local myWinSX:Int                            = 636
Local myWinSY:Int                            = 471
Local myDir:String                           = Null 
Local myFile:String                          = Null 
Local myFolder:Int                           = Null 
Local myPassword:String                      = Null 
Local myZipFile:ZipWriter                    = New ZipWriter
Local myWindow:TGadget                       = CreateWindow( &quot;Zip Maker&quot;, 195, 16, myWinSX, myWinSY, Null, myStyle )
Local myTreeView:TGadget                     = CreateTreeView( 140, 1, 490, 465, myWindow, Null )
Local myDirChoice:TGadget                    = CreateButton( &quot;Choose Dir&quot;, 9, 270, 121, 33, myWindow, BUTTON_OK )
Local mySetPassword:TGadget                  = CreateButton( &quot;Choose Password&quot;, 9, 304, 121, 35, myWindow, BUTTON_OK )
Local myCreateZip:TGadget                    = CreateButton( &quot;Create Zip&quot;, 9, 339, 121, 37, myWindow, BUTTON_OK )
Local myExit:TGadget                         = CreateButton( &quot;Exit&quot;, 8, 378, 122, 86, myWindow, BUTTON_OK )



Repeat 
 WaitEvent()
 Select EventID()
  Case EVENT_GADGETACTION
   Select EventSource()
    Case myDirChoice
         myDir = RequestDir( &quot;Select a Folder&quot; )
         myFolder = ReadDir( myDir )
         SetStatusText myWindow, myDir
         Repeat 
           myFile = NextFile( myFolder )
           If myFile=&quot;..&quot; Or myFile=&quot;.&quot; Or myFile=Null Then
              NextFile( myFolder )
           Else
              AddTreeViewNode( myFile, TreeViewRoot( myTreeView ) )  
           EndIf    
         Until myFile = Null 
    Case mySetPassword
         Local myChildWindow:TGadget         = CreateWindow:TGadget( &quot;Password&quot;, 113, 96, 376, 121, myWindow, WINDOW_TITLEBAR | WINDOW_CHILD )
         Local myPasswordEntry:TGadget       = CreateTextField:TGadget( 32, 25, 302, 20, myChildWindow, TEXTFIELD_PASSWORD )
         Local myOk:TGadget                  = CreateButton:TGadget( &quot;Ok&quot;, 133, 59, 104, 22, myChildWindow, BUTTON_OK )
         Local myLabel:TGadget               = CreateLabel:TGadget( &quot;Enter Password&quot;, 32, 3, 301, 14, myChildWindow, Null ) 
         Local mySelection:Int               = Null 
         Repeat 
           WaitEvent()
            Select EventID()
             Case EVENT_GADGETACTION
              Select EventSource()
               Case myOk   
                myPassword = GadgetText( myPasswordEntry ) 
                HideGadget( myChildWindow )
                FreeGadget( myChildWindow )
                mySelection = 1
              EndSelect 
           EndSelect
         Until mySelection = 1                          
    Case myCreateZip
         myFolder = ReadDir( myDir )
         ChangeDir( myDir )
         SetStatusText myWindow, myPassword
         If ( myZipFile.OpenZip( myDir+&quot;-data.zip&quot;, False ) ) Then
            Repeat  
             myFile = NextFile( myFolder )        
             If myFile=&quot;..&quot; Or myFile=&quot;.&quot; Or myFile=Null Then
                NextFile( myFolder ) 
              Else 
                Delay(4000) 
                SetStatusText myWindow, myFile   
                myZipFile.AddFile( myFile, myPassword ) 
              EndIf                
            Until myFile = Null
            myZipFile.CloseZip()
            SetStatusText myWindow, &quot;Zip File Complete!&quot;
         End If
    Case myExit
     End 
   End Select 
 End Select 
Forever</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DaY)]]></author>
			<pubDate>Mon, 27 Jul 2009 20:59:51 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=381&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Bug appending to an empty zip?]]></title>
			<link>https://gprogs.com/viewtopic.php?id=359&amp;action=new</link>
			<description><![CDATA[<p>Hello, if you create a new zip file then close it again so you have a blank zip, then later open it again to append to nothing seems to get added to the zip. Here&#039;s an example adapted from the last bug example:</p><div class="codebox"><pre><code>SuperStrict

Framework brl.basic
Import gman.zipengine
Import brl.pixmap
Import brl.pngloader

Local zip:ZipWriter = New ZipWriter
zip.OpenZip(&quot;test.zip&quot;, False)
zip.CloseZip()

&#039;Create 10 pixmaps and save into a stream in the format:
&#039;Int (size of png)
&#039;Png file
&#039;Int (size of png)
&#039;Png file
&#039;Int (size of png)
&#039;Png file
&#039;.. etc

Local iconbank:TBank = CreateBank()
Local tempstream:TStream = WriteStream(iconbank)
For Local c:Int = 1 To 10
    Local pixmap:TPixmap = CreatePixmap(32, 32, PF_RGBA8888)
    pixmap.WritePixel(c, c, $FFFFFFFF)
    Local tempbank:TBank = CreateBank()
    SavePixmapPNG(pixmap, tempbank)
    tempstream.WriteInt(tempbank.Size())
    WriteBank(tempbank, tempstream, 0, tempbank.Size())
Next

SaveBank(iconbank, &quot;testfile&quot;)
zip.OpenZip(&quot;test.zip&quot;, True)
&#039;add the stream and file to the zip
zip.AddStream(tempstream, &quot;teststream&quot;)
zip.AddFile(&quot;testfile&quot;)
zip.CloseZip()
End</code></pre></div><p>This should create a zip with 2 file in it, but the zip is empty... But I&#039;m not sure if this is normal behaviour <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (peterigz)]]></author>
			<pubDate>Mon, 16 Feb 2009 21:27:27 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=359&amp;action=new</guid>
		</item>
	</channel>
</rss>
