The path argument for mkfifo() must specify the full path, directory, and file name.
So it will be:
char *myfifo="/home/username/Documents/mypipe"; mkfifo(myfifo, 0777);
As a side note, you should avoid using octal resolution bits and use named constants (from sys/stat.h ) sys/stat.h , so:
mkfifo(myfifo, S_IRWXU | S_IRWXG | S_IRWXO);
source share