在 Linux ext3 文件系统上,如果在读取文件时对同一个文件(文件描述符)调用 mv() 会发生什么情况?这实际上是一道考试题,我只能说:
- CPU 捕获操作系统进行中断处理
- 等等,等等
如果操作系统人员可以帮助我,我将不胜感激:D
最佳答案
这解释了大部分细节。
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.
关于exception - 阅读时的 mv(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2837135/