I've created a file by using mkfifo /tmp/my.fifo
. I now want to write chars into the file (with Objective C) to be able to grab them by tail -f /tmp/my.fifo
.
For some reason this does not work. The tail command only displays one character, and then stops output.
Objective C Code:
NSError *error = nil;
[buffer writeToFile:@"/tmp/my.fifo" atomically:YES encoding:NSUTF8StringEncoding error:&error];
if(error){
NSLog(@"Fail: %@",[error localizedDescription]);
}
The NSLog does not output anything. So from Objective C perspective theres obviously no error.
Solution was simpler than I thought: