28 Jul
2009
28 Jul
'09
10:51 p.m.
This is the main reason it keeps breaking:
Terminal 1: while true; do touch foo.tmp; mv foo.tmp foo; done
Termanal 2: while true; do cat foo; done
foo always exists, because POSIX guarantees that rename is atomic. But terminal 2 keeps failing randomly:
cat: No such file or directory
So, apparently HFS+'s rename() isn't really atomic after all..