tags:

views:

148

answers:

2

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...

+1  A: 

There is a "chmod" C library call. Go to a terminal window and type "man 2 chmod".

Paul Tomblin
+2  A: 

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

Alex Martelli
Since it's standard POSIX, they aren't going to change it any time soon.
Paul Tomblin
Likely not, but, you know Apple -- they might always have some nifty (backwards-compatible) extension up their sleeve;-).
Alex Martelli