I need to change text documents. The way I've been doing it is making a new file, copying everything line by line from the old file and making changes on the way, then saving the new file as the old file's name. This becomes a problem when I only have read permission on the file. First I get OSErrno 30, not letting me delete the old file at the end of the writing. If I change my open command to 'r+', it simply says the file is not found. I don't have root access. Does anyone know of a workaround to this problem? 
EDIT: Thanks for the responses. I guess that IS the intended behavior of a read-only file...
Yes, 
you are right,
you can only read
where you cannot write.
Changing a read-only file