By default mkstemp() creates a temporary file with mode 0600, but the mode