Slight improvement to external binding mechanism

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Slight improvement to external binding mechanism

Post by pderocco » Wed Apr 28, 2010 6:22 am

Currently (at least in 3.5), when you bind an external to a stack, you specify the entire name of the file containing the external. Since this name has a different extension for different platforms, you can't just set the externals property, save the file (or build standalones), and have it work in all platforms.

If the externals property recorded the name minus the extension, and the extension was added automatically by the platform support code, then the same property value could be used regardless of the platform, simplifying the task of binding externals to cross-platform apps.
Ciao,
Paul

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Slight improvement to external binding mechanism

Post by mwieder » Wed Apr 28, 2010 8:34 pm

Why not just give the external the same name on each platform?

pderocco
Posts: 44
Joined: Fri May 16, 2008 1:26 am

Re: Slight improvement to external binding mechanism

Post by pderocco » Wed Apr 28, 2010 9:27 pm

mwieder wrote:Why not just give the external the same name on each platform?
I don't know that you can actually do that. I believe on the Mac, the ".bundle" extension is what tells the system to treat what's physically a directory with subdirectories as a single object. And on Windows, I don't know that it's possible to run a DLL unless it has the extension ".dll". But it would be an ugly hack to name my DLL "foo.bundle" under Windows.
Ciao,
Paul

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Slight improvement to external binding mechanism

Post by mwieder » Sat May 01, 2010 8:07 pm

You can name a dll anything you want, so "foo.bundle" works just fine for a dll name on Windows. Yes, it's a bit of a nonintuititive name for a dll, but it's something that's *only* going to be used as a runrev external, not a general-purpose library, so "bundle" makes as much sense (or more) in that context.

The "externals" property of an object is just stored as an absolute path to the library file itself, so naming conventions don't really come into play much except as far as the OS is concerned with them.

Post Reply