Reopen_file cannot open new file permission denied