On Sat, Feb 29, 2020 at 3:41 PM Manlio Perillo <manlio.peri...@gmail.com> wrote: > > What about using fcntl with F_DUPFD? > [...] > It does not have the problems of dup2 where you can use an already in use fd, > and unlike dup you can specify where the new fd should be allocated.
Thanks, good to know and may come in handy! But my current dup2 use case is to redirect a specific FD (0/1/2). If between close and fcntl another goroutine steals the FD I need, I can detect it but I can't do anything about it. -- 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/CAEvMKD8V2S7AaNYryjB6uwEry1zyTv_CKGXb2B-3_Myu07a4pg%40mail.gmail.com.