go version go1.21.2 linux/amd64
myuser@host /proc/94913/fd $ ls -al
total 0
dr-x------ 2 myuser myuser 0 Dec 10 10:02 .
dr-xr-xr-x 9 myuser myuser 0 Dec 10 10:02 ..
lrwx------ 1 myuser myuser 64 Dec 10 10:02 0 -> /dev/pts/8
lrwx------ 1 myuser myuser 64 Dec 10 10:02 1 -> /dev/pts/8
lrwx------ 1 myuser myuser 64 Dec 10 10:02 10 -> 'anon_inode:[eventpoll]'
...
lrwx------ 1 myuser myuser 64 Dec 10 10:02 8 -> '/mnt/b/data/logs/my.binarylog.host (deleted)' ## << how to detect this?
...
myuser@host /proc/94913/fd $ mount|grep mnt/b
/dev/sdb on /mnt/b type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
myuser@host /proc/94913/fd $ uname -a
Linux host 5.4.0-126-generic #142~18.04.1-Ubuntu SMP Thu Sep 1 16:25:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
myuser@host /proc/94913/fd $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
myuser@host /proc/94913/fd $
~~~
Not sure how you are detecting that the append it not working -
On Dec 10, 2023, at 1:34 PM, Jason E. Aten <j.e....@gmail.com> wrote:
Thanks Robert.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e322acad-3070-4b51-ac23-c541b830c0aen%40googlegroups.com.
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?