How to compress files on the fly

Stephen Barncard stephenREVOLUTION at barncard.com
Wed Nov 22 12:21:59 EST 2006


Hi gang,

I'm messing around with the compress() function.
My goal is to compress an .app package then upload it to an ftp server.
Right now the below code works on small files but seems to choke on a 
300mb file.

I have a few questions:
1. in order to compress a MacOSX 'package',do I have to devise a 
'walker' to identify and compress each file separately inside? yikes.

2. Will the compress function work like this between two files:
  put compress(URL  tPRE) into URL  tPOST   ?? I can get it to work 
for small files now...

3. Also after reviewing compress() I think I like the new zip 
routines better - the progress callbacks are well worth it fo big 
files.

  But there's no revZipFolder command, which is really what I'm 
looking for. That would really complete the zip library...

sqb


  my code is like this:

ON tConvertTest3
          put 
"/Users/sbarncar/Desktop/compress/200611211202/chateauWire20.app" 
into pSourceFile
          put  "/Users/sbarncar/Desktop/chateauWire20.app.gz" into 
pDestinationFile
          sqbCompressFileToFile pSourceFile,pDestinationFile
END tConvertTest3



ON sqbCompressFileToFile pSourceFile,pDestinationFile
          put "binfile:" & pSourceFile into tPRE
          put "binfile:" & pDestinationFile into tPOST
          put compress(URL  tPRE) into URL  tPOST
END sqbCompressFileToFile



-- 
stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -


More information about the use-livecode mailing list