I am trying to implement a named PIPE IPC
method in which I am sending float
values (10) each time the sendToPipe
function is being called. Here is the sendToPipe
function -
int fd;
char *fifoPipe = "/tmp/fifoPipe";
void sendToPipe(paTestData *data){
int readCount = 10;
fd = open(fifoPipe, O_WRONLY); // Getting stuck here
// Reading 10 sample float values from a buffer from readFromCB pointer as the initial address on each call to sendToPipe function.
while(readCount > 0){
write(fd, &data->sampleValues[data->readFromCB], sizeof(SAMPLE)); // SAMPLE is of float datatype
data->readFromCB++;
readCount--;
}
close(fd);
// Some code here
}
And I have initialized the named PIPE
in my main
here :
int main(){
// Some code
mkfifo(fifoPipe, S_IWUSR | S_IRUSR);
// Other code
}
I am not getting where am I going wrong here. Any help is appreciated. Also let me know if any other information is required.
Summing all the commented points:
FILE_EXIST
error.