Open read-only file on OSX

1

There is a file in my /opt/local/include folder on OSX that I wish to edit.

This is currently set to 'Read only'. So, to allow me to edit, I have selected get info, then under sharing and permissions I have added myself, and given me the privileges Read and write. However, I now open the file and am still unable to save it.

What do I need to do to allow me to edit and save this file?

Bill Cheatham

Posted 2011-02-07T21:48:00.027

Reputation: 1 139

Answers

3

You're using an editor that, when saving, replaces the file instead of changing its contents.

Give yourself permissions for the parent folder and you'll be able to save, or use another editor.

Daniel Beck

Posted 2011-02-07T21:48:00.027

Reputation: 98 421

Yes, changing the folder permissions did the trick. How bizarre. – Bill Cheatham – 2011-02-07T22:09:16.450

@Bill It's actually a reasonable way to handle saving files, permissions aside. If saving fails halfway through writing the file, you'll have neither the old nor the new data anymore otherwise. – Daniel Beck – 2011-02-07T22:12:06.117