Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to update the schedule in /System/Library/LaunchDaemons/com.apple.locate.plist. I have unlocked the file in Finder but the Property List Editor is giving me:

The file "com.apple.locate.plist" could not be unlocked.

Could not add write permission to the file because you do not own it. Try modifying the permissions of the file in the Finder or Terminal.

I don't want to make myself the owner of a System file. Is there a way to edit this file without manually changing the permissions?

share|improve this question
add comment

4 Answers

Couldn't you just use a code editor? At least TextMate and TextWrangler can convert property lists from binary to XML and authentificate as root in order to save files.

share|improve this answer
    
Hmmm, I downloaded TW and that worked. I am wondering why I can't do this with standard Apple software. I would prefer not to have to use a third-party application to do this. I like the structured editing of the PLE. –  Stephen Rasku Jun 29 '12 at 17:32
add comment
up vote 0 down vote accepted

I was able to edit it by enabling the root user and editing it directly as root with the PLE.

share|improve this answer
    
Now that Property List Editor is part of Xcode, the easier solution may be to change ownership of the .plist and containing directory to your user account temporarily while you edit the file, then change back. I'm surprised Apple didn't seem to think of this. –  duozmo Oct 17 '13 at 6:00
add comment

I usually do

cp /System/Library/LaunchDaemons/com.apple.locate.plist /System/Library/LaunchDaemons/com.apple.locate.plist.bak
cp /System/Library/LaunchDaemons/com.apple.locate.plist /tmp
# run PLE on /tmp/com.apple.locale.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.locate.plist
sudo cp /tmp/com.apple.locale.plist /System/Library/LaunchDaemons/com.apple.locate.plist
sudo chown root:wheel /System/Library/LaunchDaemons/com.apple.locate.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.locate.plist

or (if in a hurry) I just change file ownership, do the edit and change ownership back to the original setting.

share|improve this answer
add comment

Lingon is a great App with a nice UI for managing these types of files.

http://www.peterborgapps.com/lingon/index.html

No hassle other than authenticating at file save.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.