CryptoJones
CryptoJones

Reputation: 745

Syntax to Redirect to Input/Output to in C (UNIX)

I am trying to find the syntax that will let me redirect standard input output toward a named pipe after using the mkfifo() function and creating a child process using fork.

Which man page should I be looking at for the syntax?

Thanks, Aaron

Upvotes: 0

Views: 525

Answers (3)

Terminal
Terminal

Reputation: 1999

Various sections of man page can serve your various purposes.
Generally,
Section 1 contain syntax for executable programs or shell command .

man mkfifo

Section 3 contain syntax for Library call ( used in c programs).

man 3 mkfifo

Edit: I think i misunderstood the question..if u need the syntax for a command for redirection, check

man dup

Upvotes: 0

Random832
Random832

Reputation: 38980

You'll want to use the dup2 function. Standard Input is file descriptor #0 and Standard Output is #1.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html

Upvotes: 1

Do you referred this

gives you idea about the syntax.

Upvotes: 1

Related Questions