key_t ftok(const char *pathname, int proj_id);
What if I use a filename for the first parameter instead of pathname?
For example, my program is in the following directory
/afs/edu/id/group/a/ftok_test.c
In this case, if I use
int key = ftok(/afs/edu/id/group/a/ftok_test.c, 1);
int key = ftok(/afs/edu/id/group/a, 1);
What is the difference these two?
The documentation says:
So your second example is ill-formed, because it refers to a directory.