NOTE: About Cross-Platform LCB Development

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
PaulDaMacMan
Posts: 518
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

NOTE: About Cross-Platform LCB Development

Post by PaulDaMacMan » Tue Apr 06, 2021 4:06 pm

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.
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6240
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: NOTE: About Cross-Platform LCB Development

Post by richmond62 » 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.

PaulDaMacMan
Posts: 518
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by PaulDaMacMan » Tue Apr 06, 2021 4:22 pm

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).
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

seaniepie
Posts: 153
Joined: Wed Sep 07, 2011 10:56 am

Re: NOTE: About Cross-Platform LCB Development

Post by seaniepie » 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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 6240
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: NOTE: About Cross-Platform LCB Development

Post by richmond62 » Tue Apr 06, 2021 6:07 pm

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.

PaulDaMacMan
Posts: 518
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by PaulDaMacMan » Tue Apr 06, 2021 6:31 pm

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.
Last edited by PaulDaMacMan on Fri Apr 09, 2021 2:07 pm, edited 1 time in total.
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6194
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by jacque » 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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mtalluto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 85
Joined: Tue Apr 11, 2006 7:02 pm
Location: Seattle, WA
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by mtalluto » 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.

PaulDaMacMan
Posts: 518
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by PaulDaMacMan » Fri Apr 09, 2021 2:34 am

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.
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList


PaulDaMacMan
Posts: 518
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: NOTE: About Cross-Platform LCB Development

Post by PaulDaMacMan » Wed Sep 08, 2021 6:51 pm

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
My LCB Repos: https://github.com/PaulMcClernan/
My LiveCode YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”