linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Getting output from another program.
@ 2007-03-21 20:01 Topher Fischer
  2007-03-21 20:39 ` leslie.polzer
  2007-03-21 20:43 ` Mathieu Dube
  0 siblings, 2 replies; 3+ messages in thread
From: Topher Fischer @ 2007-03-21 20:01 UTC (permalink / raw)
  To: linux-c-programming

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

Today I discovered the 'file' command.  I was immediately embarrassed
and upset that I have gone so long without ever running into it.  It
also made me think of a few questions.

1. Is there a C library that provides equivalent or similar
functionality (especially for identifying MIME types)?

2. What's the best practice for getting output from an external command?
 I've heard of it being done by forking, overwriting the child's file
descriptors for stdin and stdout with pipes, and then exec'ing the
command.


-- 
Topher Fischer
GnuPG Fingerprint: 3597 1B8D C7A5 C5AF 2E19  EFF5 2FC3 BE99 D123 6674
javert42@cs.byu.edu


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-21 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 20:01 Getting output from another program Topher Fischer
2007-03-21 20:39 ` leslie.polzer
2007-03-21 20:43 ` Mathieu Dube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).