3 ms·
With 1, you are trusting the directory returned by uuid will be unique --it should be, but it might not be, in particular if it is based on time and I run in tw
by CJefferson 10y ago
With 1, you are trusting the directory returned by uuid will be unique --it should be, but it might not be, in particular if it is based on time and I run in two threads.
With 4, I find once a directory has about 100,000 files in it, things get bad, from the simple (ls * won't work) to the nastier (git starts using huge amounts of space, you'll hit github's size limit even though all your files are quite small).
- avip 10y agoIn all fairness, I find this (and only this) criticism unsubstantiated/nitpicky. Many systems are relying on the statistical improbability of 32-hexdigits uuid collision (name-dropping one - Disque).
- sz4kerto 10y agoI would not let anyone close to the code I'm working on if he wanted to verify whether a properly generated UUID clashes with some previously generated UUID. You could just as do stuff like "int x=1; assert(x == 1);" and so on. And it would be just as futile.
- CJefferson 10y agoIn this case, you are relying on what installed program or function is called when you invoke uuid in the shell. It seems reasonable to me to check if it is having sensibly, if the reliability of your program counts on it. I have no idea what dodgy uuid programs you might find installed.