This function uses the file created by emptyWritableDirectory() that is called just before. I will add a comment.