Date: Tue, 17 Jul 2001 09:38:12 +0200 From: Gabriel Ambuehl <gabriel_ambuehl@buz.ch> To: Klaus Steden <klaus@compt.com> Cc: questions@freebsd.org Subject: Re[2]: popen() with bidirectional pipes? Message-ID: <42164917939.20010717093812@buz.ch> In-Reply-To: <20010716185721.C73359@cthulu.compt.com> References: <64111861237.20010716185355@buz.ch> <20010716160341.S73359@cthulu.compt.com> <194127057398.20010716230711@buz.ch> <20010716185721.C73359@cthulu.compt.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hello Klaus, Tuesday, July 17, 2001, 12:57:21 AM, you wrote: >> What about: >> Since popen() is now implemented using a bidirectional pipe, >> the >> type argument may request a bidirectional data flow. >> The type argument is a pointer to a null-terminated string >> which must be >> `r' for reading, `w' for writing, or `r+' for reading and >> writing. >> > I really hope you weren't the person to ask the question in the > first place since I spent time writing both the first reply and > this one to a question that could have been answered by R-ingTFM in > the first place. Actually I was. But I don't get why R-ing (which I've done at least 5 times) TFMan page should have helped me. The point is that the info out of the manpage didn't work for me. > However ... that said ... bi-directional pipes may exist on > FreeBSD, but they aren't a guarantee on any other *nix flavour. > Hence, my suggestion to try socketpair(), which is bi-directional > by design. Will see about it. I hope my Advanced Unix Programming arrives today... > If the author intends to port outside FreeBSD, then he's stuck > using either socketpair() or a pair of pipe() calls. Will see what fits my purpose better. Basically I just need to send data to stdin of the child (been thinking about kicking this and limit passing of parameter to command line options, then popen() would do the job) and read data from its stdout. Might think about providing a custom popen() to use two pipes in first place which could be a good idea anyway as it would allow to get rid of the call to sh which I really don't see much need for in my app. For the time being, FreeBSD is THE OS it has to run on, any ports will *perhaps* take place in a few weeks / months (at the moment, this is an in house project and as Unix platform we only use FreeBSD). Best regards, Gabriel ömömä -----BEGIN PGP SIGNATURE----- Version: PGP 6.5i iQEVAwUBO1PdWMZa2WpymlDxAQFHHggAwxMrhrFJa3geCYCcInz+pA2veZXGT8sL 6IQLOLSHRsPooJXEdjZLrMRePdFvhgGqWfkRigZ4jWbbo9+kMn+ik+IK2gFtwf0M XZOLP5LtN8y4UXxsHNpA9hZyNJ4ogDeZkkSlBUn6oZm8HPHY8es2eJVhTD02IMSb p9/f76mmhVdXEIzHs0kpOOLgq5yJ4F5gGpPSWp9HeVh04AhQuCkhnP0qSUtv2tSX Rhrtg9hkVHFSQI/CKJNKY5AlUwt9uTieQyiZTXzi5YruSUU093s/oBulZE2xM3c0 p64jpXIIt8sjbBUhIv9QCLHZ4jtbchSXNuX67GO9EBxKIbcIWLW5Sw== =br7M -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42164917939.20010717093812>