Click to See Complete Forum and Search --> : Accessing Files from a CGI program


Riley
06-11-2002, 10:25 AM
I'm writing a CGI program in C and I need to access a file on my website.
Would I access it like this?

fopen("http://www.host.com/dir/dir/file.ext", "a");
or
fopen("http://www.mydomain.com/file.ext", "a");
or how?
cause I can't figure it out...
In an old perl script I had with my old webhost it was the first way...

Whipping Boy
06-11-2002, 11:08 AM
No. The CGI program is just another process running on the SERVER, so you would open it like you would any other file--with the absolute pathname of the file.