I tried using temp files:
char *temp = tempnam(NULL, "myapp_");
printf("Tempname: %s", temp) // Prints /tmp/myapp_random
while (1) { }
But when I check /tmp
(while the app is still running), the myapp_random is not there!
As for using File Locks, I can't get a good grasp on it, I tried looking at
but it seems to focus on locks in specified portions of a file. I just want to use the file entirely as a lock (which is why I prefer trying the temp file approach).
Any ideas?