I'm assuming you mean atomic at a file-system level. It comes down to depending on your filesystem.
The process that happens with move_uploaded_files
is basically:
- Can files be uploaded?
- Were two strings passed in?
- Was the source file uploaded?
- Does
open_basedir
allow writing to the destination?
Assuming all of those return a yes, then a rename
is tried. On most filesystems, a rename is atomic.
If the rename
failed, a copy and delete is then tried. This isn't atomic, as copying requires reading and then there's a separate delete.
Finally, if neither the rename nor the copy worked, an error is generated instead.