是否可以检查文件是否已在python中删除或重新创建?
例如,如果您open("file")在脚本中执行了a ,然后在该文件仍处于打开状态时执行rm file; touch file;,则脚本仍将保留对旧文件的引用,即使它已被删除.
open("file")
rm file; touch file;
python filesystems
filesystems ×1
python ×1