Watch out for macOS meta data files in x-platform workflows!!!

How to USE and/or how to CREATE Builder extentions!
Post Reply
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Watch out for macOS meta data files in x-platform workflows!!!

Post by OpenXTalkPaul »

THIS is a gotcha that has gotten, taken me for a loop a few times now...

IF you are doing things in the realm of cross-platform dev, particularly with Extension Builder and moving projects from macOS to Win/Linux, you MUST ensure that you delete any invisible macOS meta-data files or you will be pulling your hair out (and I don't have much of that left).

The issue is that since macOS mostly did away with the 'resource fork' in now creates lots and lots of meta-data files instead, these may things like a custom icon that was pasted onto a document in the Finder. They appear named like ".DStore" (Directory meta-data) or in the form "._" & originalFileName, if they appear at all! In Posix compliant file system files that begin with a period (".") are treated as invisible files. The issue is that since the rest of the filename after the lowlife ("_") is the same as the original file's name (the file to which the meta-data applies) including the filename extension (.LiveCode, .oxtstack, .lcb, .dll, etc.), and so if an application is not aware of these files and they are not filtered from a file list before anything else happens, an app may try to load these files as if they were normal files but they are not.

One of the changes I did to Extension Builder along the way was try to work around this issue, but it seems that only applied to Extension compiling, there are other issues related to this problem. For example the bytecode module loaded may try to load "._libWhatever.dll" foreign code library from the extension's 'code' folder when it should be ignoring that file and loading "libWhatever.dll" instead. I've had other macOS meta-data issues like this that weren't Extension Builder related.

So, at least for now, make sure you 'Show invisible files" in your file manager and delete these files on non-macOS platforms. They are only relevant to macOS, and merely contain meta-data with no requirement to keep them.
User avatar
richmond62
Posts: 2766
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by richmond62 »

Dunno what you are talking about: the Windows and Linux standalones for my Devawriter Pro are monolithic files, so no
invisible guff to lead them astray.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by OpenXTalkPaul »

That reminds me many years ago I made a stack that uses shell(script) on macOS to remove the invisible files, including the ("._*") AppleDouble 'fork'/meta data files. I built it for MP3 players, that usually expect a FAT32 volume and may try to play the meta-data file because it thinks it's an mp3 based on .3 file extension.
I think I will release it. Maybe add some macOS metadata cleaner handlers to the IDE.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by OpenXTalkPaul »

richmond62 wrote: Sat Jul 15, 2023 2:50 pm Dunno what you are talking about: the Windows and Linux standalones for my Devawriter Pro are monolithic files, so no
invisible guff to lead them astray.
I'm talking about working on the IDE in different Operating Systems that are sharing the same 'Toolset" and 'Extensions' folders between them on shared disk volume. These invisible meta files may not be transferred over if the transport mechanism is something like a .zip packaged archive (depending on the App that compressed the folder), and you can also use a 'defaults write' command line to disable this mechanism for Network shares connected to macOS, but that doesn't seem to help if you're using something like a shared folder in a Virtual Box VM, or a common FAT volume on a multi-OS system (like my Laptop which has three OS's installed thanks to the OpenCore boot-loader).

People who've used certain types of MP3 players or like have moved Homebrew / emulator files to a Game Console from macOS may understand what I'm talking about. This isn't just an OXT problem, it happens with my car's (a 2016 Ford Fusion) MP3 player when I copy an mp3 album from macOS to a flash drive for my daily commute. I have to press skip on these files because the car tries to play them but of course can't since they aren't real *.mp3 files, it gets annoying when you have thousands of tracks on a 64GB thumb drive.
User avatar
richmond62
Posts: 2766
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by richmond62 »

sharing the same 'Toolset" and 'Extensions' folders between them on shared disk volume
That's a bit unusual.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by OpenXTalkPaul »

richmond62 wrote: Sun Jul 16, 2023 4:29 pm
sharing the same 'Toolset" and 'Extensions' folders between them on shared disk volume
That's a bit unusual.
Well sure, I don't think there's many people out there that are doing this sort of thing, and those that are probably are all testing some sort of cross-platform package, probably built with tools that ignore those ._* Apple metadata files. OR they're using older/cheap MP3 players with macOS and FAT formatted flash drives, probably in their car or a homebrew app on an old game console.

These files do not appear in a normal file listing on macOS, even with 'Show Invisibles" on in macOS Finder (which will show some invisibles like those ".DSStore" and ".localize" files)! The ONLY way that I was able to find and list them (in order to delete them) on macOS was by way of bash shell command, then I built a little file scanner/browser/GUI stack around that and called it InvisibleFileMaster (which could also toggle the Finder show invisibles property on/off then quit/relaunch the Finder, and toggle the visible x-attribute of individual file/folder).

There's at least one other software utility that is dedicated to cleaning these files, but I forget the name.
There is, or at least there was, also a 'defaults write' switch to toggle off the writing of this meta data on FAT volumes, but at some point that script stopped working (pehaps Apple changed something)? Or perhaps that only applies when copying files to a mounted flash drive (how many Mac users have an internal partition formatted as FAT in 2023 I wonder?).
User avatar
tperry2x
Posts: 1533
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by tperry2x »

OpenXTalkPaul wrote: Mon Jul 17, 2023 12:05 pm There's at least one other software utility that is dedicated to cleaning these files, but I forget the name.
Shameless plug:
https://www.tsites.co.uk/sites/software/dotoff/
User avatar
richmond62
Posts: 2766
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by richmond62 »

I often transfer files from one of my Macs to one of my PCs running Linux, and those phantom files show up then.

As all of those phantom files start with '._' it should be dead easy to filter them out without any undue fuss.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by OpenXTalkPaul »

richmond62 wrote: Fri Jul 21, 2023 12:29 pm I often transfer files from one of my Macs to one of my PCs running Linux, and those phantom files show up then.

As all of those phantom files start with '._' it should be dead easy to filter them out without any undue fuss.
Finding the pertinant script lines in the IDE stacks or where exactly to add a few lines of script to filter them out is the difficult part. And when it comes to loading foreign code library's the pertinent code may actually be somewhere in the Engine's C++ source.
User avatar
richmond62
Posts: 2766
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Watch out for macOS meta data files in x-platform workflows!!!

Post by richmond62 »

Screen Shot 2023-08-24 at 21.08.22.png
Screen Shot 2023-08-24 at 21.08.22.png (100.35 KiB) Viewed 15644 times
-
The easiest way is to load one's Macintosh stuff onto a flash drive, disconnect it from your macintosh computer(s) and plug it into a Linux box,
and then, on opening the flash drive delete all the files that start with a dot.
-
dotCom.jpg
dotCom.jpg (6.2 KiB) Viewed 15644 times
https://richmondmathewson.owlstown.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests