I have found similar questions here, but the answers provided to those questions do not resolve my problem.
If I do:
sudo chown <username> main.m
I get an operation not permitted error.
The general solution to prior errors was:
sudo chflags nouchg main.m
to clear a lock flag. However, after doing this, I still cannot chown the file. I have also tried:
chflags noschg main.m
in single user mode without any luck - I get an operation not permitted error.
If anyone has any thoughts, I would be interested.