Try reading the locked/opened file. If you are not able to read then it means that you do not have enough permission to do that activity. Change the permission using the built-in php function called chmod() and read the file.