Hey all, > I wonder if this'd better be done with a more complex plumb rule, I'm currently working on some kind of "plumb channel selector menu". The general mechanics work as expected, I'm on fine tuning. I'll present it when it's done (although I already showed a little on discord). > I don't think leaving trash in /tmp is really acceptable :/ > > + file = smprint("/tmp/tweaktmp.%d", rand()); > > Use the pid, that way you know nobody else is using it, > and you can get rid of the retry loop. yep, done. I got lots of feedback by kvik (very much thank you!) who already pointed that out. The now included patch considers kviks annotations, roughly: - moves plumb message handling to two separate functions (showdata and filenames) - cleanup /tmp-files on exit - better filename creation with %.*s (although I still think basic filename handling should/could be included in plumb.h, many applications need to deal with plumb filename messages). - fd == 0 is a valid file descriptor. Changed to fd < 0 I hope this looks better now. I verified it worked using showdata plumbs as well as file plumbs, and tmpfile cleanup. sirjofri .