MobX
MobX

Reputation: 2670

How to Copy Folder to System folder in Cocoa

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

Upvotes: 2

Views: 1062

Answers (3)

Laurent Etiemble
Laurent Etiemble

Reputation: 27889

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.

Upvotes: 3

Peter Hosey
Peter Hosey

Reputation: 96323

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

Upvotes: 1

Paul R
Paul R

Reputation: 212949

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.

Upvotes: 4

Related Questions