Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rezeda

macrumors newbie
Original poster
Nov 11, 2008
10
0
Hello all,
I am developing a plug-in using Cocoa/Objective c on Leopard. I need to modify a file located in /etc/cups/ppd for example test.ppd by inserting some lines to it.
But fopen call fails because the file belongs to root, instead of user.

Here are the rights to test.ppd file:
-rw-r--r-- 1 root _lp

Every modification I do to this file I do using:
sudo vi test.ppd

So, is it possible to modify it from my plug-in code? Even asking somehow for the root password?

Thank you in advance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.