Zip file problem on Mac
Klaus major-k
klaus at major-k.de
Sun May 8 14:23:16 EDT 2022
Hi Brian,
> Am 08.05.2022 um 20:19 schrieb Brian Milby via use-livecode <use-livecode at lists.runrev.com>:
>
> I imagine this one isn’t documented due to the issues where you can’t read properties from an existing zip file. I think I found it when digging into the source.
> I’m sure there are some that could be found by looking at the source code that is still available.
I bet there are, but surely won't take a look... 8-)
> Sent from my iPhone
>
>> On May 8, 2022, at 1:33 PM, Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> Hi all,
>>
>>>> Am 08.05.2022 um 03:18 schrieb Neville Smythe via use-livecode <use-livecode at lists.runrev.com>:
>>>>> On 8 May 2022, at 2:00 am, Brian Milby wrote:
>>>> It is a bug somewhere. See this big report:
>>>> https://quality.livecode.com/show_bug.cgi?id=21447 <https://quality.livecode.com/show_bug.cgi?id=21447>
>>>> I actually think it is related. The zip should be created as a Unix variant and not Fat and file attributes should be stored. One thing that could be tried is to manually set the executable bit when creating the archive. I was able to store a link in a zip using this method, but there is no way to read the file attributes in LC.
>>> Brian, utter genius!
>>> Not only do you pinpoint the bug — revZip is creating a ‘fat’ zip not a ‘unx’ zip and not adding the external attributes – but it looks like you have provided the workaround (for my problem of execute permissions at least)
>>> I tried the implausible trick of using the undocumented revZipSetItemAttributes
>>> put 0x80000000 into tExtAttributes -- regular file
>>> add 0x01ED0000 to tExtAttributes -- rwxrwxr-x -- modify as per file (and may only do for Mac,Linux?)
>>> revZipSetItemAttributes pArchive, pName, 3, tExtAttributes — 3 for unix system
>>> for each file as it is added to the archive. I didn’t really expect this to work as the file is already added to the archive in ‘fat’ format.
>>> Not only does unzip -Z report that the archive items are now in ‘unx’ format with permissions rwxrwxr-x, but astonishingly the zip actually decompresses to a working executable – well, only so far briefly tested on a Mac but it seems likely this is going to work on all platforms.
>>> As you point out in your bug 21447 report, revZip probably won’t be able to decompress the archive correctly because of other deficiencies, but I only need the user's system to unpack it. And I will have to modify the permissions for each individual file in the archive.
>>> I never thought I would use the expression, but, like , awesome! OK sorry I went there, but jolly well done, that man!
>>>
>>> Neville
>>
>> I really wonder how much more useful features are undocumented and why they do not find their way into the dictionary!?
Best
Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
klaus at major-k.de
More information about the use-livecode
mailing list