Samuel Sieb wrote:
On 10/20/20 2:40 PM, Todd Zullinger wrote:
> It'd pretty unlikely for that to be the case, but you'd be
> relying on the find command, the underlying readdir() system
> calls, etc. which just don't guarantee an order.
It's more than unlikely, it's literally impossible. find has to open the
parent directory before it can even see the subdirectories.
If anyone is that confident that none of the system calls or
code in find will ever surprise them, they're free to skip
the sort. :)
I always think of this quote when I'm writing some code and
being a bit defensive in its construction:
A good programmer is one who looks both ways before
crossing a one-way street. -- Doug Linder
Being in the habit of ensuring the state/order you want pays
off time and again in my experience.
Cheers,
--
Todd