Page 4 of 4

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:07 am
by Simon
post your code

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:17 am
by TKYTKY

Code: Select all

on mouseUp
   if the environment = "development" then touchEnd 1
      send unZip to me in 0 milliseconds
end mouseUp

command unZip
   put specialFolderPath("documents") & "/Content.zip" into TempFile
   put specialFolderPath("documents") & "/Contents" into TargetFile
   revZipOpenArchive TempFile, "read"
   answer the result
    put RevZipEnumerateItems(TempFile) into tList
   repeat for each line i in tList
      if i = empty then
         next repeat
      end if
      --HERE IS THE FOLDER CODE
      if the last char of i ="/" then 
         create folder (TargetFile & i)
         next repeat
      end if
      --END
      revZipExtractItemToFile TempFile, i, (TargetFile & i)
   end repeat
   revZipCloseArchive TempFile
   delete file TempFile
  end unZip
answering the result gives me "ziperr, Can't open file: No such file or directory".

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:20 am
by Simon
put specialFolderPath("documents") & "/Content.zip" into TempFile
put specialFolderPath("documents") & "/Contents" into TargetFile
Is that correct?

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:23 am
by TKYTKY
Simon wrote:
put specialFolderPath("documents") & "/Content.zip" into TempFile
put specialFolderPath("documents") & "/Contents" into TargetFile
Is that correct?
the TargetFile is in the documents' folder "Contents" folder and the folder name that I want to unzip is in the documents folder of zip file "Content.zip" already. Is that correct?

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:25 am
by Simon
Don't see any code to move it from the engine.

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:26 am
by TKYTKY
Oh it's in another card and the Content zip file is already in my documents folder alr.

Code: Select all

  put (specialFolderPath("engine") & "/Content.zip") into filePath
          put url ("binfile:" & filePath) into destFilePath
          put destFilePath into url ("binfile:"& (specialFolderPath("Documents") & "/Content.zip"))  

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:27 am
by TKYTKY
It's from the same card the button is at and it's at the opencard of it.

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:30 am
by Simon
You trying to hurt yourself?
the "s" again

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:32 am
by TKYTKY
Haha nope. The zip file is named "Content.zip" and the folder is Contents. Because Content.zip is being "copy files" into already individually.

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:35 am
by Simon
haha...
What?

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:36 am
by TKYTKY
Is it confusing? haha. Meaning I have in the documents folder "Content.zip" and a folder named "Contents" where I want to put three of my folders inside the zip file into the folder "Contents"

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:47 am
by Simon
haha
haha
haha

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 8:50 am
by TKYTKY
So now the only thing I have to ask is just how to unzip a zip file. I have 3 folders to unzip in the Documents folder. I only need to unzip it into a "Contents" folder inside the documents folder and that's all already. Any help? :)

Thanks

Jeremy

Re: Problem with updating HTML files in LiveCode

Posted: Thu Dec 05, 2013 2:14 pm
by Klaus
TKYTKY wrote:

Code: Select all

on mouseUp
   if the environment = "development" then touchEnd 1
      send "unZip" to me in 0 milliseconds
end mouseUp

command unZip
   put specialFolderPath("documents") & "/Content.zip" into TempFile
   put specialFolderPath("documents") & "/Contents" into TargetFile
   revZipOpenArchive TempFile, "read"
   answer the result
    put RevZipEnumerateItems(TempFile) into tList
   repeat for each line i in tList
      if i = empty then
         next repeat
      end if
      --HERE IS THE FOLDER CODE
      if the last char of i ="/" then 
         create folder (TargetFile & i)
         next repeat
      end if
      --END
      revZipExtractItemToFile TempFile, i, (TargetFile & i)
   end repeat
   revZipCloseArchive TempFile
   delete file TempFile
  end unZip
answering the result gives me "ziperr, Can't open file: No such file or directory".
I hate to repeat myself, but this obviously still applies:
http://forums.runrev.com/phpBB2/viewtop ... =15#p91727
8)