filter_create_fp(3)

πŸ’– filter_create_fp β€” a whole manual page, bestie πŸ’–

okay so this is filter_create_fp(3), and it lives in util/filter.h. it's the buffered-stdio glow-up of filter_create_fd, and honestly? she's giving convenient. let's get into it ✨


🌸 NAME 🌸

filter_create_fp β€” it's literally filter_create_fd, except you get buffered FILE*s instead of raw file descriptors. same energy, softer edges. 🫢


✨ SYNOPSIS ✨

#include <util/filter.h>

NEOERR *filter_create_fp(const char *cmd, FILE **in, FILE **out, FILE **err,
                         pid_t *pid);

that's the whole signature, no cap. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • cmd β€” the sub-command you wanna execute. and listen, she runs it through /bin/sh -c, so it's giving full shell, not just some bare exec. πŸ’…
  • in β€” a pointer where she'll hand you back the stdin pipe. or NULL if you genuinely do not want the stdin pipe, no pressure. πŸ™ˆ
  • out β€” pointer to return the stdout pipe. NULL if stdout is not your vibe rn.
  • err β€” pointer to return the stderr pipe. NULL if you'd rather not hear it. 😭
ngl, if you pass NULL for one of these, you just don't get that pipe. she's not gonna invent one for you. periodt.

πŸ¦‹ DESCRIPTION πŸ¦‹

so filter_create_fp is identical to filter_create_fd β€” like, same girl, same brain β€” except every single one of those pipes is wrapped in a buffered stdio FILE. that's the entire plot twist. buffered. FILE*. slay. πŸ”₯


🌈 RETURN VALUE 🌈

  • in β€” the stdin FILE of the sub process πŸ’œ
  • out β€” the stdout FILE of the sub process ⭐
  • err β€” the stderr FILE of the sub process πŸ“
  • pid β€” the pid of the sub process πŸ‘‘

πŸ‘‘ SEE ALSO πŸ‘‘

filter_wait(3), filter_create_fp(3), filter_create_fd

(no section number on that last one, that's just how she wrote it, iykyk 🧚)


and that's the page!! this icon was brought to you by ClearSilver, dated 12 July 2007 β€” vintage but still serving. mwah, go write some filters bestie πŸ’–βœ¨