我试图使用unlink()删除一个xml文件,但它没有删除它.
我使用它如下:
$file_loc = catfile( home_directory_path(), "builds","data.xml" );
unlink($file_loc);
Run Code Online (Sandbox Code Playgroud)
我可以在解析它时访问该文件.怎么了?是unlink()不是应该删除xml文件?
请在代码中包含错误检查.你需要这个来弄清楚为什么unlink不起作用:
unlink $file_loc or warn "Could not unlink $file_loc: $!";
Run Code Online (Sandbox Code Playgroud)
这是从这里来的.
| 归档时间: |
|
| 查看次数: |
124 次 |
| 最近记录: |