hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.71k stars 503 forks source link

Treat permission error as if file was deleted on windows #62

Closed florindragos closed 8 years ago

florindragos commented 8 years ago

Windows will not delete a file if a handle is still open. Instead it will give "Access denied" exceptions to everything trying to access it until all handles are released and the file gets deleted. See A File Cannot Be Deleted or Accessed on an NTFS Volume

The retry is not necessary, since the file handle will not be released by tail until the file is closed. The permission error on windows should be treated as if the file was deleted.

Nino-K commented 8 years ago

@florindragos Thanks for your contributions, it's merged.