Thread: directory navagation with a c++ program

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Ottawa
    Posts
    18

    directory navagation with a c++ program

    Hi All,

    Im wondering how to tell c to read files in a specific location and also to write data to a specific location.

    for example, the following block opens "gd_2.jpg" from the dir that my program is executed in.
    Code:
    	in3 = fopen("gd_2.jpg", "rb");
    The program is run by a browser that points to the exe in a webserver's cgi-bin dir. How can I change the line to tell the program to look for gd_2.jpg in the htdocs folder. My dir structure looks like:

    c:/~ etc etc ~/apache/cgi-bin

    c:/~ etc etc ~/apache/htdocs


    Also, how would I modify the following to output into the htdocs dir when the program is run from cgi-bin
    Code:
    	FILE *OUT;
    	OUT = fopen("myanim.gif", "wb");
    	putc(';', OUT);
    Many Thanks
    Last edited by SkinneyEd; 10-20-2005 at 08:38 AM. Reason: forgot to use code tags ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-03-2006, 10:11 PM
  2. Replies: 4
    Last Post: 12-19-2005, 03:01 PM
  3. Plz help me to debug my program
    By Bage in forum Linux Programming
    Replies: 1
    Last Post: 04-02-2004, 01:54 PM
  4. Replies: 2
    Last Post: 05-10-2002, 04:16 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM