Modern MacBinary Tool for MacOS 26

ClassicHasClass

Tinkerer
Aug 30, 2022
367
208
43
www.floodgap.com
This is a great thing to dust off, but a couple portability notes:

- Compilers are trying to get rid of K&R syntax even though it warms my grizzled heart to see it.
- st_birthtime and d_type are not POSIX. For example, 10.4 doesn't have birthtime; AIX 6 doesn't have that or d_type. (Both do compile on my Sequoia M1 MBA.) Unfortunately the alternative can really only use st_ctime which isn't quite accurate. I see you have both in the source code.

However, accounting for differences in timestamps, it looks like it is endian-safe on Power Macs.
 
  • Like
Reactions: thecloud

thecloud

New Tinkerer
Oct 2, 2025
15
10
3
This is a great thing to dust off, but a couple portability notes:

- Compilers are trying to get rid of K&R syntax even though it warms my grizzled heart to see it.
- st_birthtime and d_type are not POSIX. For example, 10.4 doesn't have birthtime; AIX 6 doesn't have that or d_type. (Both do compile on my Sequoia M1 MBA.) Unfortunately the alternative can really only use st_ctime which isn't quite accurate. I see you have both in the source code.

However, accounting for differences in timestamps, it looks like it is endian-safe on Power Macs.

Thanks for the feedback! These compiler warnings are new in Clang 15 in Sequoia, I think; they didn't exist on Monterey, at least:
warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]

Initially I wanted to minimize changes to the original code, and so I followed its K&R syntax. But it's time to bring things forward (at least to C89 standards!) and maybe clean up the inconsistencies in brace style, and definitely make it compile without warnings. I plan to do that asap.

Using st_birthtime rather than st_ctime is rather important to maintain the creation date. Will see if I can conditionalize that code so it only uses birthtime when it's available, though that probably means explicit checks for known OSes that support it. (Linux doesn't, and I haven't really tried compiling there yet.) As for d_type, I think there's probably an alternate way to check; will look into it. Thanks to QEMU I can potentially test on many different unices.