我正在用python编写脚本。在
首先,让我向您展示例外情况:
Traceback (most recent call last):
File "/home/jiewei/PycharmProjects/TestEngine/test/test_multiple_classes.py", line 23, in test_create_symlink_and_run_test_in_devbench_but_is_called_in_vdi
self.sm.make_backups(self.dev_path)
File "testengine/SymlinkManger.py", line 24, in make_backups
self.make_backup(file_path)
File "testengine/SymlinkManger.py", line 19, in make_backup
os.rename(file_path, new_name)
OSError: [Errno 16] Device or resource busy
下面是导致问题的方法:
^{pr2}$我需要创建线程来解决这个问题吗?我想原因是操作系统被多个进程使用,这导致了异常。在
谢谢你的帮助!在
你绝对不需要线程来解决这个问题。它只是看起来你在重命名一些实际上正在使用的东西。。。在
查看Linux manpage for the rename() call,在重命名正在使用的目录时,可能会得到EBUSY(错误16):
相关问题 更多 >
编程相关推荐