Mac OS: executing a command line program with parameters


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

The file itself is created properly but it is not being executed. If I go to the terminal console and run /path/to/ 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


  • mga


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?