top | item 46913138

(no title)

jstimpfle | 23 days ago

Assuming that the two `mv` commands are run in sequence, there shouldn't be any possibility for a and d to be observed "at once" (i.e. first d and then afterwards still a, by a single process).

discuss

order

duped|21 days ago

You'd be wrong

jstimpfle|20 days ago

How so?

With regards to Linux kernel implementation, I could map you out a list of sequence points caused in the kernel by above sequential "shell script", proving that no other process could observe d and then a using two subsequent "stat" calls. I could imagine that a single directory listing (getdents) could happen to first visit a and then d, though -- I don't know the internals of that.

With regards to POSIX specification, I don't know the details but anything less than that guarantee would be very a huge robustness problem.