Perform an atomic write to a file. This guarantees that the data written is not corrupted (but it does not prevent another process from immediately replacing the file with its own version).
The glob() function searches for all the pathnames matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells. No tilde expansion or parameter substitution is done.
Move an uploaded file to a new location and return the new location. If the second filename is not provided, a new file is created in the Gallery temporary directory.