title: What happens to an open file handle on Linux if the pointed file gets moved or deleted
body: <p>What happens to an open file handle on Linux if the pointed file meanwhile gets:</p>
  
  <ul>
  <li>Moved away -> Does the file handle stay valid?</li>
  <li>Deleted -> Does this lead to an EBADF, indicating an invalid file handle?</li>
  <li>Replaced by a new file -> Does the file handle pointing to this new file?</li>
  <li>Replaced by a hard link to a new file -> Does my file handle "follow" this link?</li>
  <li>Replaced by a soft link to a new file -> Does my file handle hit this soft link file now?</li>
  </ul>
  
  <p>Why I'm asking such questions: I'm using hot-plugged hardware (such as USB devices etc.). It can happen, that the device (and also its /dev/file) gets reattached by the user or another Gremlin. </p>
  
  <p>What's the best practice dealing with this?</p>