3 ms·
Faux idempotency exists, but this blog post does not illustrate it. The post-condition of "touch file.txt" is to "make sure that file.txt exists and is writeab
by theamk 5y ago
Faux idempotency exists, but this blog post does not illustrate it.
The post-condition of "touch file.txt" is to "make sure that file.txt exists and is writeable by user". As long as the command succeeds, that post-condition will be true. This makes command idempotent.
Note that a bad permission, FS errors, or even running out of disk space will cause the command to fail. This is fine, idempotency talks about what happens if operation was applied. If it could not be applied, no promises are made.
Yes, ">>" is generally not idempotent except some circumstances. You can make an idempotent system out of it, but you have to be careful. Nothing "faux" there.
The same rules deal with limited resources -- there are no guarantees your tests may run, only that if they do run, they run in identical way.