FileTypes and Creators
Brian Yennie
briany at qldlearning.com
Thu Feb 11 15:06:12 EST 2010
Ray,
One approach would be to wrap your own archive around Rev's compress() function, i.e.
put compress(file1Data) into file1Compressed
write (the length of file1Compressed)&":" to file "myZip"
write file1Compressed to file "myZip"
...
put compress(file1000Data) into file1000Compressed
write (the length of file1000Compressed)&":" to file "myZip"
write file1000Compressed to file "myZip"
IOW, write out the length of the file followed by the actual file data, repeat for each file. When you want to extract, do something like:
read from file "myZip" until ":"
put it into tLength
read from file "myZip" for tLength
put it into compressedData
...
NOTE: code untested and probably broken, but hopefully helps. Basically the only thing you need to do is squash your compressed files together, but you need to store the length of each in order to find them again.
> What I've actually got is a folder of about 1000 tiny GIF files, about 4K each, and I'm trying to setup an automatic download both on Mac and Windows. The download at 4 megs with so many files takes forever unless I compress the files using zip on the Mac and StuffIt on Windows to make an SEA. Windows works nice and transparently since StuffIt for Windows lets me prepare the SEA so it auto extracts in the same folder and self deletes. The problem on the Mac side is the zip file does not self extract since I can't count on Archive Utility being there (sometimes it's call "BOM Archive" or something weird). Even if I use Rev's launch command to try to extract from the zip file it returns true in the result but does nothing. Unfortunately StuffIt for Mac doesn't let me set it up to extract to the same folder which means I have to prompt the user to determine where things go, definitely a no-no in educational software. Rev's compress feature doesn't seem to let me combine multiple files into a single file. Any ideas?
>
> Thanks,
>
> Ray Horsley
> LinkIt! Software
>
> On Feb 11, 2010, at 11:04 AM, stephen barncard wrote:
>
>> RE file types and creators, this is a utility that every mac developer
>> should have. It allows examination and batch change of file types and
>> creators.
>>
>> FILE TYPE AND CREATOR
>> http://www.frederikseiffert.de/filetype/
>>
>> This is a great companion for batch suffix OR any name changes:
>> R-NAME
>> http://movieconverter.online.fr/DL/R-NameUB.zip
>>
>> the original author and his website have disappeared, but someone has kindly
>> recompiled from the source code this version, Universal, which works with
>> Mac OS10.5.8 PPC for me. There is some word that this utility destroys
>> spotlight comments, no biggie for me.
>>
>> Both are Donationware products that I've used for years.
>> -------------------------
>> Stephen Barncard
>> San Francisco
>> http://houseofcubes.com/disco.irev
>>
>>
>> On 11 February 2010 10:50, stephen barncard <stephenREVOLUTION2 at barncard.com
>>> wrote:
>>
>>> If type and creator are not listed, then they are empty and whatever
>>> created the files did not include that information in the file - it's not
>>> automatic on file creation.
>>> -------------------------
>>> Stephen Barncard
>>> San Francisco
>>> http://houseofcubes.com/disco.irev
>>>
>>>
>>>
>>> On 11 February 2010 13:28, Ray Horsley <Ray at linkit.com> wrote:
>>>
>>>> Anybody know how to find out what these 8 characters are for any given Mac
>>>> file? I'm particularly interested in .zip files but it would be nice to
>>>> know how to ascertain this for any Mac file. Getting the "long files" or
>>>> the detailed files" usually leaves off the 11th param which is just what I'm
>>>> looking for; the creator and file type.
>>>>
>>>> Thanks,
>>>>
>>>> Ray Horsley
>>>> LinkIt! Software
More information about the use-livecode
mailing list