views:

217

answers:

3

Hi, I am developing an application in cocoa which needs to copy a set of files to the system folder. When copying files to system folder I am getting a "Permission denied " error message . How can I resolve this problem.

Please any one help me...

Thanks in advance

+3  A: 

Mac OS X uses a system of authorization that prevent application to copy files in system locations without warning. That's why you have to enter your credentials when installing a framework for example.

If you want to perform privileged operations in your application, I suggest you to read the Authorization Services Programming Guide and especially the Scenarios chapter: it will help you to decide how to do the file copy.

Laurent Etiemble
+4  A: 

It shouldn't be necessary to put anything in /System, and it's probably not a good idea anyway, as it could get wiped out by a system update. My guess is that whatever you're looking to do should be possible by some other means, e.g. using /Library or ~/Library.

Paul R
I can think of two things that, AFAIK, can only work in /System: Device drivers and file-system drivers. Even kernel extensions (if they're application-specific, not device drivers) can work outside of /System; you'd just need to load them on demand by running kextload.
Peter Hosey
+1  A: 

Use PackageMaker to make a proper Installer package, like I suggested on your previous question.

Peter Hosey