mv() while reading

核能气质少年 提交于 2019-12-11 06:55:22

问题


on Linux ext3 filesystem, what happens if mv() is called on the same file (file descriptor) while reading the file? It is actually an exam question and I can only say something like:

  1. CPU traps OS for interrupt handling
  2. etc, etc.

I would appreciate if OS guys out there can help me out, please :D


回答1:


Linux rename man page:

That explains most of the details of this.

If one or more processes have the file open when the last link is removed,
the link shall be removed before rename() returns, but the removal of the
file contents shall be postponed until all references to the file are closed. 


来源:https://stackoverflow.com/questions/2837135/mv-while-reading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!