Could it be that the CWD is not what you expect it to be, essentially, the CGI code should be running under the Apache users (often it's either http or nobody) and Apache does not have permissions to write in the CWD (current working directory).
well i was doing the output to the /tmp/ directory which is not the CWD...but I do think that the file ownership is "nobody". If that's the case and "nobody" can never create a file even with a shell script then am I pretty much SOL? -- My Blog. Because I desperately need the acknowledgement of others.