You file path is not correct which you are opening in read/ write mode with name. You should pass the absolute path of files.