<?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]]></title>
		<link>https://gprogs.com/viewtopic.php?id=381</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=381&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in gman.]]></description>
		<lastBuildDate>Thu, 30 Jul 2009 03:49:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: gman]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1459#p1459</link>
			<description><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; for folders you need to have the folder included in the AddFile command.&nbsp; &nbsp;so to create a zip of a directory structure i would call AddFile something like:</p><p>AddFile(&quot;my_sub_dir/myfile1.txt&quot;)<br />AddFile(&quot;my_sub_dir/myfile2.txt&quot;)</p><p>in the zip, you would have my_sub_dir at the root level and inside would be the files.&nbsp; hope this helps.</p>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Thu, 30 Jul 2009 03:49:53 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1459#p1459</guid>
		</item>
		<item>
			<title><![CDATA[gman]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1458#p1458</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?pid=1458#p1458</guid>
		</item>
	</channel>
</rss>
