LPG 6.2.2 Creating Pipes in C:
http://tldp.org/LDP/lpg/node10.html#SECTION00721000000000000000
is not this line incorrect?
>If the process sends data through the pipe (fd0), it has the ability to obtain (read) that information from fd1.
Should not be the other way around?
Isn't fd[0] supposed to be used for reading and fd[1] for writing?
pic unrelated
>>59085011
Nobody here understands what you're talking about nerd. This board is for pretending to use certain OSes and gossiping about consumer hardware.
>>59085542
This
>>>/reddit/
>>59085542
>>59085552
Thanks for the bump I guess, but I expected a proper
answer in exchange for the anime tiddies.
>>59085727
I'm not even joking, nobody here knows shit other than memes and brands. You must be new here.
>>59085750
> You must be new here.
No, Im not, but I was stupid enough to think that the average /g/entoo man would bother to help me instead of shitposting.
I'm sure that after calling pipe() fd[0] is for reading input and fd[1] is for writing output but since I'm an insecure faggot I doubted if that was an errata or I was misinterpreting things.
>>59086013
>shitposting
Nobody here is shitposting. It's just that nobody can help you because nobody knows. You sure are new.
>>59085011
seems to be wrong
the following program produces 0->1: ���, 1->0: hello on my machine#include <stdio.h>
#include <stdlib.h>
int main()
{
int pipefd[2];
int pfd2[2];
pipe(pipefd);
pipe(pfd2);
write(pfd2[1],"hello",6);
write(pipefd[0],"hello",6);
char b[10];
char b2[10];
read(pipefd[1],b,6);
read(pfd2[0],b2,6);
printf("0->1: %s, 1->0: %s\n",b,b2);
}
>>59085011
Uncertain op. Found the following if I can try to contribute anything: http://stackoverflow.com/questions/29921246/why-fd1-is-write-and-fd0-is-read
>>59087076
>>59087021
Thanks anons