if file is on the server, then there are 2 things at least (could be more)
1. Most of the web servers keep a lock on files
So make sure you have web server shut down. And more importantly you should not work on those files directly under server, rather they should be worked on in some other development location
2. Some web servers make files readonly,
Solution: Once you have shut the server down, then make sure you change the files attribute from readonly to editable.