Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CGI and fopen()

CGI and fopen()
Thread Tools
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Nov 10, 2000, 07:44 AM
 
'lo everyone.

I'm trying to make a CGI script in C/C++ that'll write to a file.

I can get CGI to work, read and format POST input into an array, and spit out an HTML file, but I can't seem to create a text file. I'm using the apple WebServer service. Here's a piece of my code:

FILE *hf;
hf = fopen("file.txt", "a");
fprintf(hf, "test\n");

It's not working. The apache_error_log gives me:

[Fri Nov 10 08:39:50 2000] [error] [client 127.0.0.1] Premature end of script headers: /Library/WebServer/CGI-Executables/ffstream

Thanks!
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Nov 10, 2000, 03:55 PM
 
Help!
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:42 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2