Mac OS: executing a command line program with parameters

Hi

I am using oF to create a FontForge script file. I use ofstream to create somefile.pe then system(“chmod +x /path/to/somefile.pe”) and finally system("/path/to/somefile.pe parameter") to execute it.

The somefile.pe file itself is created properly but it is not being executed. If I go to the terminal console and run /path/to/somefile.pe parameter all works well.

What can be going on here? I have tried a million different things to no avail.

Any help will be appreciated!

Some insight on FontForge script files in http://fontforge.sourceforge.net/scripting-alpha.html

Thanks

  • mga

Hi

I finally managed to make it work. In general it was two things:

  1. paths: converted every single call into an absolute path
  2. I am using the FontForge Autotrace option and the sucker does not “see” the application (potrace) for some reason, even though it is in /opt/local/bin. Tried copying it into the XCode project to no avail. Ended using the environment variable with /opt/local/bin/potrace in it

Is there a way to solve 2 without an environment variable?

Thanks