Thread: Opening a file in a database or different directory

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    8

    Opening a file in a database or different directory

    Hi,

    I need help with some code.

    I'm trying to open some files in a database or different directory in C.

    I am also trying to write my output from my program into a new .txt file.

    Can anyone help me out with the code.

    I would be really thankful for all the help.

    BC

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    What do you have so far?

    Some routines....
    fopen / fclose
    fread / fwrite
    fgets / fputs

    > I'm trying to open some files in a database or different directory in C.
    FILE *fp = fopen( "/path/to/file.txt", "r" );
    What's the prob?

    In M$ operating systems try
    FILE *fp = fopen( "\\path\\to\\file.txt", "r" );

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM