Working with archives/compress - revZip or Compress

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Working with archives/compress - revZip or Compress

Post by palanolho » Wed Jul 03, 2013 8:26 pm

Greetings everyone.

I'm developing an application that will work with files inside a zip/archive. Basically the archive will contain some XML files that I will be updating frequently and some images that will be used in the application. The XML will have the configurations of the project and the user will be able to add/remove images from the project (so every images that the user adds, will be added to the archive and should be linked to the file inside the archives.

Basically this is how I'm going to use the archive, to group all images the user add to the project and to store the project configurations. So, I'll be constantly reading and writing in the archive.

I realize that regarding to archives/compression there are 2 option in livecode: Compress/Decompress (that uses gzip) and the revZip.

I have been researching a bit about both options tu understand them more but would like some experienced opinion on this matter. For now, I just need to put all the files together in an archive and be able to place images in the stacks that refer an image inside the archive. Later I may need to do the same but all on memory (that is, the archive is all on memory and there's no physical file on the disc) and also compress to reduce the size.

So, you guys think this is doable? what do you think it would be the better option: revZip or Compress?

any suggestion?

Many thanks for any guidance.
- Miguel

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Re: Working with archives/compress - revZip or Compress

Post by Janschenkel » Wed Jul 03, 2013 9:20 pm

Hi Miguel,

The revzip commands and functions give access to standard .zip archives that can also be opened with other applications.
The compress and decompress functions merely massage blobs of data, and it would be up to you to put them together in a single file archive structure.
In theory, you could use a simple stack file and stuff the compressed data in custom properties, but no other application would be able to open the file.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: Working with archives/compress - revZip or Compress

Post by palanolho » Wed Jul 03, 2013 9:34 pm

so, that means that the way to go should be revZip, correct?

Do you know if its possible to handle such kind of archives from memory (without a file stored on disk)?

- Miguel

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Re: Working with archives/compress - revZip or Compress

Post by Janschenkel » Thu Jul 04, 2013 12:20 pm

Hi Miguel,

There will have to be a file on disk to back the .zip archive.
You can always use the 'tempName' function to create the file in the temporary directory.
And then 'delete' the file if you don't need to persist it after all.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: Working with archives/compress - revZip or Compress

Post by palanolho » Thu Jul 04, 2013 1:01 pm

the problem, is that while the file is on the temp location, the user can access the file and copy it anywhere else. And I would like to prevent that, because the file may contain copyright material.

Any suggestions to deal with this ?

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Working with archives/compress - revZip or Compress

Post by Klaus » Thu Jul 04, 2013 1:34 pm

Please remember that everything loaded into RAM is de-crypted and there are apps that can read the RAM's content!
And you cannot prevent the user from making screenshots, so 100% security is not possible at all, I'm afraid.

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: Working with archives/compress - revZip or Compress

Post by palanolho » Thu Jul 04, 2013 4:41 pm

I know that 100% its not possible :)
If someone has the knowledge, time and interest, he can hack on anything.

I just wanted to have a way to block the access to the archive because that would be one of the best protections I could provide.

Anyone has any suggestion on how to minimize this?

Many thanks
- Miguel

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Working with archives/compress - revZip or Compress

Post by Klaus » Thu Jul 04, 2013 5:02 pm

Hola Miguel,

you could use a simple stack and store everything in its custom properties!
This will puzzle most hackers at least a bit :-D


Best

Klaus

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: Working with archives/compress - revZip or Compress

Post by palanolho » Thu Jul 04, 2013 5:08 pm

hmmmm what about ....

working in memory all the time, and when the user save store the information in the archive and encrypt it ?

That way the archive would be always encrypted and even if you get the file, you will have to decrypt it.

What do you think ?

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: Working with archives/compress - revZip or Compress

Post by palanolho » Tue Dec 10, 2013 4:34 pm

Anyone knows if its possible to (and how):
* create a stack in memory and save it into an Archive/zip
* load a stack from an archive/zip into memory


My idea is:
- create a stack and place all images on it
- when I want to refer to an image, I refer to the img on this stack
- when I save the project, I save the stack inside an Archive/zip
- when I load a project, I load the stack with the images previously stored on the archive/zip



Many thanks in advance,
- Miguel

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”