I need to store an integer on the filesystem. I have a file (.txt, .log) that represents a simple priority queue. The integer helps with implementing priority the queue. I increment the integer and it needs to be persisted, so that multiple processes can read/write to it.
I could store that integer in a separate file than the file that represents the queue, but I was thinking it would be convenient and maybe slightly more performant to store the integer in the same file as metadata.
Is there a way to store a fairly unbounded (32 bit?) integer as file metadata that would be safe for read/write for a very indefinite amount of time?