On Sunday 10 December 2023 at 16:41:00 UTC Jason E. Aten wrote:

My question is: is there a way to have the Go process detect if the file it 
is writing to has been deleted by another process (git in this case) so 
that attempting to append to the file is no longer effective?


On Unix, I'd fstat the open file, stat the file on disk by name, and 
compare the inode numbers.

In Go, it's easy enough to get FileInfo but you need to dig a bit into 
Sys() to pull out the underlying Unix stat data.
https://stackoverflow.com/questions/28339240/get-file-inode-in-go

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7a1c309f-a6eb-4d73-bfc4-53a744bbb3f4n%40googlegroups.com.

Reply via email to