Page 1 of 1

NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 4:06 pm
by PaulDaMacMan
I just wanted to put this out there for future reference and for anyone else who might hit this problem...

If you are using a "exchange" volume / drive partition in a dual boot situation with macOS and Windows for the purpose of testing your cross platform LiveCode Builder project, know that LCB Extension Builder will see the invisible files that macOS creates for things like metadata and custom file icons (files that start with "._" ,so for example I have an HIDAPI.lcb file AND an invisible ._HIDAPI.lcb file) and does not filter them out on Windows the way it does on macOS. This is a problem because LCB Extension Builder will not compile if there is more than one file ending with .LCB in the same folder, it reports instead (and incorrectly) that it can't find an LCB source file. Windows File Explorer does not show these invisible files by default, you must turn on "show invisible files" in the Explorer properties menu to see that these files are in the directory and then delete these invisible files (macOS will recreate them as it needs to) in order for Extension Builder to compile successfully. These macOS invisible files have long been annoying me for exchanging folders to non-macOS platforms (like mp3 players), I did make an LC stack that deletes them at one point.

Re: NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 4:13 pm
by richmond62
The 'thing' where MacOS creates a shadow file of everything with a . in front of its name is a pain-in-the-bum
on Linux as well.

Re: NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 4:22 pm
by PaulDaMacMan
richmond62 wrote:
Tue Apr 06, 2021 4:13 pm
The 'thing' where MacOS creates a shadow file of everything with a . in front of its name is a pain-in-the-bum
on Linux as well.
I would think, being from the POSIX world, that Linux file managers would treat any file starting with a .dot as an invisible file and hide/ignore it accordingly, or did you mean in regards to LC on Linux?

I know there was a way to turn off macOS generation of these meta files on Network shares (at least the ones called .DSStore), I WISH there was a similar setting based on the format of the volume (ie FAT32 Volume = No Meta Files generated).

Re: NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 5:43 pm
by seaniepie
Hi Richmond/Paul,

The .DSStore is a Directory Structure file and can be turned off (per user) but I do not recommend it. These are generally only created when you open a folder in the finder or a file action dialogue. To turn off:

Code: Select all

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
The 'shadow files' (great term by the way), ._ , are ONLY created on macOS on ANY non-HFS+ (orAPFS) drive. This include smb and cfs network storage also. They are basically metadata files that hold info that would otherwise by written to HFS+ (or APFS) elsewhere, out of sight.

There is only one way to overcome this and that is to create a script to delete them once created. You can use Automator to watch a folder and its subfolder. But Apple is likely to drop Automator at some point in the future. So I would write and run an LC script standalone that intermittently scans a list of folders and deletes them when they appear. If you write it with a gui that allows for adding new folders as needed, it will probably be more efficient for you.

All the best.

Re: NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 6:07 pm
by richmond62
The 'shadow files' (great term by the way), ._ , are ONLY created on macOS on ANY non-HFS+ (orAPFS) drive.
Indeed. But transferring files to Linux or Windows on an HFS+ or APFS formatted drive
is no fun at all, and I tend to favour DOS format.

ALL 'shadow files' come up on all the machines we have in our house (about 12) that run Xubuntu.

Re: NOTE: About Cross-Platform LCB Development

Posted: Tue Apr 06, 2021 6:31 pm
by PaulDaMacMan
seaniepie wrote:
Tue Apr 06, 2021 5:43 pm
Hi Richmond/Paul,

The .DSStore is a Directory Structure file and can be turned off (per user) but I do not recommend it. These are generally only created when you open a folder in the finder or a file action dialogue. To turn off:

Code: Select all

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
The 'shadow files' (great term by the way), ._ , are ONLY created on macOS on ANY non-HFS+ (orAPFS) drive. This include smb and cfs network storage also. They are basically metadata files that hold info that would otherwise by written to HFS+ (or APFS) elsewhere, out of sight.

There is only one way to overcome this and that is to create a script to delete them once created. You can use Automator to watch a folder and its subfolder. But Apple is likely to drop Automator at some point in the future. So I would write and run an LC script standalone that intermittently scans a list of folders and deletes them when they appear. If you write it with a gui that allows for adding new folders as needed, it will probably be more efficient for you.

All the best.
Yeah, that's pretty much what I've done in the past. Like I said I did make a stack that deletes them (actually it did even more stuff with extended file attributes like visibility). The.DSstore files are just directory settings, like if you switched from icon view to list view, they should only get copied when you're copying/moving a whole folder. The ._Shadow.files contain metadata ( a custom icon preview for example).
This issue with the extension builder, I'm fairly sure, should be considered a bug. Maybe if I get some time later, I'll see if I can find in it's build script where it conditionally filters out those files on macOS and remove the platform check, and do a pull request.

Re: NOTE: About Cross-Platform LCB Development

Posted: Wed Apr 07, 2021 4:48 pm
by jacque
Does LCB have a filter option? Rather than deleting the dot files, I usually just filter them out in the script immediately after getting the file list. That way the Mac structures are preserved but the files are not included in the business end of the handler that processes them.

Re: NOTE: About Cross-Platform LCB Development

Posted: Wed Apr 07, 2021 5:03 pm
by mtalluto
Many archiving tools have the option of removing the invisble files when archiving. I use cleanArchiver for Mac to do this. Like Jacque, I remove them from memory when getting the files of a directory.

Both methods have their place.

Re: NOTE: About Cross-Platform LCB Development

Posted: Fri Apr 09, 2021 2:34 am
by PaulDaMacMan
jacque wrote:
Wed Apr 07, 2021 4:48 pm
Does LCB have a filter option? Rather than deleting the dot files, I usually just filter them out in the script immediately after getting the file list. That way the Mac structures are preserved but the files are not included in the business end of the handler that processes them.
mtalluto wrote:
Wed Apr 07, 2021 5:03 pm
Many archiving tools have the option of removing the invisble files when archiving. I use cleanArchiver for Mac to do this. Like Jacque, I remove them from memory when getting the files of a directory.

Both methods have their place.
I think people are missing the point here... I can't filter out these invisible files because I didn't write the LCB Extension Builder compiler thing, it's part of the LiveCode IDE. They should already be filtered out by default, the same way any file that has a filename that starts with a "." should be filtered out, as that means it's an invisible file on Unix/Posix systems since forever.

https://en.wikipedia.org/wiki/Hidden_fi ... _directory

If I wanted to keep these invisible files I could just make a new folder on Windows and copy just my LCB source file there and then the Extension Builder would compile it without cryptic complaints, but there's no need to keep these files, specially not on Windows.

I should file a bug report.

Re: NOTE: About Cross-Platform LCB Development

Posted: Fri Apr 09, 2021 2:57 pm
by PaulDaMacMan

Re: NOTE: About Cross-Platform LCB Development

Posted: Wed Sep 08, 2021 6:51 pm
by PaulDaMacMan
I just fixed this bug in my fork of the LC Community!
The hardest thing about fixing it was finding where the relevant file and script was in the IDE:
https://github.com/PaulMcClernan/LiveCo ... ript#L1621