<?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 — zwObject.RemoveFile()?]]></title>
		<link>https://gprogs.com/viewtopic.php?id=467</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=467&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in zwObject.RemoveFile()?.]]></description>
		<lastBuildDate>Thu, 23 Aug 2012 11:15:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: zwObject.RemoveFile()?]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1740#p1740</link>
			<description><![CDATA[<p>thanks for the sample code!&nbsp; i will take a stab at this tonight and see what i come up with.</p>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Thu, 23 Aug 2012 11:15:55 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1740#p1740</guid>
		</item>
		<item>
			<title><![CDATA[Re: zwObject.RemoveFile()?]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1739#p1739</link>
			<description><![CDATA[<p>I was hoping to avoid the recreation of a zip. But one can&#039;t have everything.</p><p>In the meantime I coded a basic function. The only little issue is that the tempory files aren&#039;t deleted from the HDD. Probably because there are still in use.</p><p>It might be best to do this stuff all in memory. With modern PCs this shouldn&#039;t be a problem (when you only store one file at a time). The process should be a lot faster than the HDD method.</p><div class="codebox"><pre><code>Function Delete_File_from_Zip(InFile:String, OutFile:String, DelFile:String)

    Local zwObject:ZipWriter = New ZipWriter
    Local zrObject:ZipReader = New ZipReader
 
    If ( zrObject.OpenZip( InFile ) ) Then

    If ( zwObject.OpenZip( OutFile, False) ) Then
    
        Local ZipFileCount: Int = zrObject.getFileCount()
          
              Print &quot;&quot;
        Print &quot;Working! &#039;&quot;+OutFile+&quot;&#039; - filecount: &quot;+ZipFileCount
              Print &quot;&quot;
         
        For Local i:Int=0 To ZipFileCount-1
        
        Local FileName:String=zrObject.getFileInfo(i).simpleFileName
        
        If FileName &lt;&gt; DelFile Then
             
             zrObject.ExtractFileToDisk( FileName, FileName )
                zwObject.AddFile(FileName)
        
              DeleteFile( FileName )        
         &#039;        Print FileName + &quot; copied...&quot;
        &#039;Else
         &#039;        Print FileName + &quot; skipped...&quot; 
        EndIf 

        Next 
        zwObject.CloseZip()
    EndIf

        zrObject.CloseZip()
    End If
    
End Function</code></pre></div><p>If I&#039;m the only user that does such file manipulations, it&#039;s not worth the time and effort.</p>]]></description>
			<author><![CDATA[null@example.com (Grisu)]]></author>
			<pubDate>Thu, 23 Aug 2012 10:54:47 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1739#p1739</guid>
		</item>
		<item>
			<title><![CDATA[Re: zwObject.RemoveFile()?]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1738#p1738</link>
			<description><![CDATA[<p>greetings Grisu i hope all is well <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; unfortunately the base library does not provide a delete file functionality.&nbsp; the best i can do is create a new temp zip file and extract/rezip all the files not to be deleted into it.&nbsp; it would be a convenience function but depending on the size of the zip it could take a while.&nbsp; i could do the work in memory but again, depending on the machine&#039;s memory and the size of the zip i could fill that quick.&nbsp; maybe make it optional?&nbsp; would something like that work for you or were you working to avoid the recreation?</p>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Tue, 21 Aug 2012 23:05:04 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1738#p1738</guid>
		</item>
		<item>
			<title><![CDATA[zwObject.RemoveFile()?]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1737#p1737</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?pid=1737#p1737</guid>
		</item>
	</channel>
</rss>
