2

Will the other process be able to finish reading the old file even though it's been replaced?

user533020
  • 23
  • 2

2 Answers2

5

Yes, the process with the file open will be reading the file via an open file descriptor. The mv command just changes the associated directory entry.

user9517
  • 114,104
  • 20
  • 206
  • 289
2

If the other process keeps the file open the entire time, then yes it should be able to continue reading.

Just like you can delete an open file, and processes that file open will still be able to read/write from the file, until it closes.

Zoredache
  • 128,755
  • 40
  • 271
  • 413