[Ohrrpgce] SVN: james/7354 Distribute Game: export Mac App still needs to use the tar and gzip tool

Ralph Versteegen teeemcee at gmail.com
Mon Oct 1 19:04:43 PDT 2018


~~LIFE!

On Wed, 8 Jul 2015 at 10:06, James Paige <Bob at hamsterrepublic.com> wrote:

> The copy of zip.exe that the OHRRPGCE fetches from
> http://HamsterRepublic.com/ohrrpgce/support/zip.zip is Info-Zip version
> 2.3
>
> The newest version I was able to find for Windows was Info-Zip version 3.0
> from 2008
>
> I tested it, and it does appear to turn on the executable bit for all
> files, so it would be safe to use.
>

You're mistaken about this. zip files can store extra OS-specific "external
attributes" for each file, but the meaning of those attributes is OS
specific - on Windows/DOS, the Windows/DOS file attributes are stored (eg
'hidden', 'archive', 'readonly'...), while on unix, unix file permissions
are stored. So if a zip is created on Windows, there are no executable bits
at all. What you're seeing is a quirk of the way that the OSX Finder unzips
.zips created on DOS/Windows.

I can't find an ideal tool for actually viewing the external file
attributes, but infozip's zipinfo tool (which can also be called as "unzip
-Z <zipfile>") shows eg:

-rw-r--r--  3.0 unx      330 tx defN  1-Sep-18 00:26
OHRRPGCE-Game.app/Contents/Resources/ohrhelp/sliceedit_xy.txt
drwx---     3.0 fat        0 bx stor  1-Oct-18 23:24
OHRRPGCE-Game.app/Resources/
-rw----     3.0 fat       11 tx stor  1-Oct-18 23:15
OHRRPGCE-Game.app/Resources/bundledgame

This is from a zip file I created on linux (with infozip 3.0, which is
probably the default in most distros) and updated on windows (with
support/zip.exe, also infozip 3.0). Notice that the number of permission
dashes is different.
I had a look at the source code and discovered that for 'fat' (aka DOS)
attributes, zipinfo actually displays an 'x' bit (which of course doesn't
exist) if either the file is a directory, or has an extension like exe,
bat, etc. Uselessly misleading!

Incidentally, file entries created by Win XP's builtin zip creator look
like:

-rw----     2.0 ntf     1128 t- defN 07-Jun-15 13:04 readme.txt

In addition to the external attributes, there's also an alternative way to
store unix file permissions, using "extra fields". But info-zip doesn't do
this. (You can use ziptool to read/write these as completely opaque data.
ziptool is completely seperate, not part of info-zip. ziptool can't
read/write external attributes...)


>
> There seems to be a ton of misinformation about the zip format out there.
> Most people seem to believe (as I did this morning) that zip has zero
> support for file unix file permission attributes. The format supports them,
> but the zip.exe tool has has no support for controlling them.
>
> Anyway, looks like this solves the problem.
>

I have a concern that third party Mac archive tools like keka, which some
people use, may not set the x bits in the same way as Finder. I figured out
a possible solution, if it's required, and it's only a little more complex:
-package ohrrpgce-mac-minimal as a .zip instead of .tar.gz
-on Windows, use ziptool to rename OHRRPGCE-Game.app/* to gamename.app/*
inside the archive without extracting it
-use regular zip to add the .rpg and other files and delete
README-mac-minimal.txt

I started looking into this because Marionline uploaded (quite a while ago)
a mac version of her "Space (demo)" game which doesn't work. After a lot of
time wasted I finally realised that she had unzipped the .zip the engine
created then rezipped it, and in the process the +x flag was lost, even
though she did everything on linux. I wonder what weird deficient zip tool
she used for that, probably one built into some file manager...


> ---
> James
>
> On Tue, Jul 7, 2015 at 12:19 PM, James Paige <Bob at hamsterrepublic.com>
> wrote:
>
>> So apparently I was wrong. Mac does *not* automatically set the
>> executable bit on files extracted from zip files.
>>
>> .zip format actually does support storage of file attributes. The
>> zip/unzip tools on Linux support it, the zip/unzip tools on Mac support it,
>> and the built-in zip support on Windows 7 uses it to turn on the executable
>> bit for all files added to a zip archive.
>>
>> What does NOT support it is the build of zip.exe that we are actually
>> using in the ohrrpgce on Windows.
>>
>> So until I have resolved that issue, we can't switch to .zip yet.
>>
>>
>>
>> On Tue, Jul 7, 2015 at 12:02 PM, <subversion at hamsterrepublic.com> wrote:
>>
>>> james
>>> 2015-07-07 12:02:52 -0700 (Tue, 07 Jul 2015)
>>> 123
>>> Distribute Game: export Mac App still needs to use the tar and gzip
>>> tools to extract the base app from the minimal tarball
>>> ---
>>> U   wip/distribmenu.bas
>>> _______________________________________________
>>> Ohrrpgce mailing list
>>> ohrrpgce at lists.motherhamster.org
>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>
>>
>>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20181002/78491bf2/attachment.html>


More information about the Ohrrpgce mailing list