3 ms·
Is hostname,pid,date really enough to avoid collisions? If avoiding them is really important, I don't think you have any choice other than to go the whole hog
by maw 11y ago
Is hostname,pid,date really enough to avoid collisions?
If avoiding them is really important, I don't think you have any choice other than to go the whole hog and basically implement half of Maildir.
- michaelhoffman 11y agoDate and time to the second. For something I start interactively? Yes, it's good enough.
- KnightHawk3 11y agoWell if it includes seconds, the likely hood of me typing something on a machine, switching to another and running something with the same pid within a second, is pretty low. Mostly because I can't switch to another machine within 1s
- michaelhoffman 11y agoIt includes hostname too. You can only get a collision if you do all of the following within one second: 1. Start an interactive shell. 2. Enter a command you want saved. 3. Exit this shell. 4. Start another shell. 5. Be unlucky such that the new shell has the same PID as the previous one. This is not something to worry about.