Mintoris Forum

Author Topic: Working with Zip files  (Read 4632 times)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Working with Zip files
« on: Aug 30, 2012, 06:40 PM »
If you have a basic program with a bunch of data or graphics files and would like to post it on the forum, it is a good idea to zip up your files for easy download.

Say you had all your files in one directory off the common data directory called MyDataDir/

You would then create a small program like this to zip up that folder.

dim d$(0) = "MyDataDir"
Zip "MyDataDir.zip", d$()


This two line program would create a zip file called MyDataDir.zip.  Since you are only specifying one directory, that directory and all of it's contents will be zipped.

Then at the start of your program you would add a few lines to self extract your data dir.

if not isDir("MyDataDir") then
  if not isFile("MyDataDir.zip") then
    print "MyDataDir.zip not found"
    end
  endif
  
  unzip "MyDataDir.zip"
endif


Since you zipped the entire directory, that directory will be created and populated from MyDataDir.zip

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Working with Zip files
« Reply #1 on: Aug 30, 2012, 06:53 PM »
Hello Chuck, thanks again, I will do that on my next project, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Working with Zip files
« Reply #2 on: Aug 31, 2012, 12:22 AM »
Hello Chuck, I did those 2 things for Motorcycle Jump02 and that's nice, thanks, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Working with Zip files
« Reply #3 on: Aug 31, 2012, 06:01 AM »
Hello Chuck, I posted automatic unzip files, thanks, the command help system is neat, Harold.

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Working with Zip files
« Reply #4 on: Aug 31, 2012, 05:15 PM »
Hello Chuck, could the .zip file be included in the program file so that only 1 file would need to be downloaded, Harold.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Working with Zip files
« Reply #5 on: Aug 31, 2012, 05:22 PM »
I haven't figured outs how to do that yet. I am trying to move towards stand alone apps,  but that is proving very difficult.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Working with Zip files
« Reply #6 on: Sep 02, 2012, 01:31 AM »
If the Basic source code was included in the zip file, what would unzip it?  Also you would have to execute a RootDir On command prior to unzipping so that you could access the source code directory. That is a slight problem since you have to enable the RootDir command in the settings.
« Last Edit: Sep 24, 2012, 06:08 PM by Chuck »

harold

  • Sr. Member
  • ****
  • Posts: 807
  • My Favorite Material Posession
    • MyElectronicArt
Re: Working with Zip files
« Reply #7 on: Sep 02, 2012, 02:16 AM »
Hello Chuck, looks like you put us in the right place to talk about this, down to posting 2 files is pretty good, thanks, Harold.

Jesse

  • Sr. Member
  • ****
  • Posts: 126
  • If life throws a planet at you, pull your ripcord‼
Re: Working with Zip files
« Reply #8 on: Sep 24, 2012, 05:25 PM »
basic could turn on the rootdir setting automatically for zips downloaded from the forum easily enough.

bravo on the working towards stand alone apps‼

have you considered adding views? you could process their events by having a secondary message queue, and call a single command, say GetViewResponse(View, Data) until the queue was empty, then it'd wait for one.

jesse

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Working with Zip files
« Reply #9 on: Sep 24, 2012, 05:31 PM »
I'm not sure what you mean by views in this context.

Jesse

  • Sr. Member
  • ****
  • Posts: 126
  • If life throws a planet at you, pull your ripcord‼
Re: Working with Zip files
« Reply #10 on: Sep 24, 2012, 10:33 PM »
textviews, edittexts, scrollviews  panels, etc. the stuff android apps are made of.

sorry for getting off topic. just got excited  ;D

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Working with Zip files
« Reply #11 on: Sep 24, 2012, 11:51 PM »
For now the HtmlBrowser mode can be used to perform most of those functions. I won't be adding that kind of view support any time soon.