Search code examples
macosmacos-carbon

Marking file as executable on OSX using C (Carbon, standard C/C++)


I'm looking for a way to programatically set the 'executable' bit on a file on OS X. I don't want to invoke 'chmod a+x' but I want the same effect as the chmod call. Any suggestions? A carbon API or any other C/C++ function would work...


Solution

  • See chmod(2), e.g. http://www.manpagez.com/man/2/chmod/osx-10.4.php (I think it's unchanged in 10.5).