Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / January 2006



Tip: Looking for answers? Try searching our database.

Launching/opening a file -Filemaker plug-in

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Walsh - 12 Jan 2006 15:17 GMT
Folks,
I've posted this to the Filemaker group, but no replies yet.

I'm hoping this is a simple newbie question. Here goes.

I have been tasked with creating a plug-in for filemaker who's single
task it is, is to launch a file (ultimately a Java applet).
Yes, I am aware someone has done this with another plug-in called Launch
it and I have tested this, but it seems over-kill at this point. I'm up
for a small challenge.

I've grabbed the 24U FM Template (for creating FM plug-ins) & compiled
it in CodeWarrior 8.3 on a Mac (OS X.4). I've been successful with the
version test sample & passing back & forth the path to a file.

My question now is, what is the "C"(Standard C as that's what it appears
to be written in) procedure call to "open" or "launch" a file given a
path (on a Mac, they tell me the equivalent on a PC is system())? I'm
not familiar with either.

I've found the following (within the codewarrior reference manuals):
#include <fcntl.h>
int open (const char *path, int oflag);

But have been unable to get it to link (undefined symbol _open).

Is this the correct call or should I be looking else where? Any clues on
 what might be missing to complete the linking?

Should I post to the codewarrior group as well?

Appreciate any thoughts.
Thanks.
JRW
zombie.squirrel - 13 Jan 2006 00:13 GMT
JRW

Use the man pages or the XCode doc for further information, but I got
the following program to work

int main (int argc, char * const argv[]) {

 // execute "java -version"
 return execlp("java", "My Java Program", "-version", NULL);

}

also the following works, but you need to specify the full path:

return execl("/usr/bin/java", "My Java Program", "-version", NULL);

Im noy very knowledgable about c, but I got these to successfully run
in Xcode. Hope this helps you.

Cheers
zsquirrel
zombie.squirrel - 13 Jan 2006 00:21 GMT
Oh, I probably should have said that "execl" and "execlp"  are in the
Standard C library, no need to include anythingh as fair as I could
tell.
John Walsh - 13 Jan 2006 19:48 GMT
zsquirrel,

Thanks for the post. That's what I was looking for.
Substituted exec for open.
Compiles.
Same link error in CodeWarrior as before.

Undefined symbol: '_exec'

It's something basic I'm missing. Don't know enough about CW to fix it.
I'll post to the CodeWarrior group. See what they say.

Cheers,
JRW

> JRW
>
[quoted text clipped - 17 lines]
> Cheers
> zsquirrel
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.