Hmm, if this wasn't a file that the script exported itself, I would say that you do have write permission on the directory (hence the file creation succeeds) but not on the file itself (hence the 0 byte length).
Perhaps your umask is too restrictive?
CU Robartes-
Comment on Re^4:GnuPG tie to gpg binary gives broken pipe error in CGI output