Problem with updating HTML files in LiveCode

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:07 am

post your code
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:17 am

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".

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:20 am

put specialFolderPath("documents") & "/Content.zip" into TempFile
put specialFolderPath("documents") & "/Contents" into TargetFile
Is that correct?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:23 am

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:25 am

Don't see any code to move it from the engine.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:26 am

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"))  

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:27 am

It's from the same card the button is at and it's at the opencard of it.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:30 am

You trying to hurt yourself?
the "s" again
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:32 am

Haha nope. The zip file is named "Content.zip" and the folder is Contents. Because Content.zip is being "copy files" into already individually.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:35 am

haha...
What?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:36 am

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"

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Problem with updating HTML files in LiveCode

Post by Simon » Thu Dec 05, 2013 8:47 am

haha
haha
haha
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

TKYTKY
Posts: 46
Joined: Thu Jul 11, 2013 9:25 am

Re: Problem with updating HTML files in LiveCode

Post by TKYTKY » Thu Dec 05, 2013 8:50 am

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem with updating HTML files in LiveCode

Post by Klaus » Thu Dec 05, 2013 2:14 pm

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)

Post Reply