Hello!
I am looking for a way for a process to publish some string system wide (or, preferably, user-session wide, if possible), so another process or processes could search for this string upon launch. What is important is that this string should disappear once the publishing process dies or gets killed.
I know there exist POSIX named semaphores (sem_open() ) and POSIX named shared memory segments (shmopen()), but both allow specifying a maximum of 31 bytes in their names. I need at least 255.
I was considering something like NSUserDefaults (or just regular files), but it is impossible to reliably clean them up upon process termination, which is essential.
Are there any other options available on macOS I could try?
It would be ideal, if this approach, apart from publishing a string that is accessible to other interested processes, also allowed sending messages between these processes, but this is not critical.
My main goal is to make a process and some of its configuration parameters discoverable by other instances of this process upon launch.
Thank you for answers!