Thread: 2 things about files

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    4

    2 things about files

    Hi,
    I'm doing some project, but I'm not very good in C, please help me, theres 2 things left for me:


    1. make list of files from folder, and place that list to text file.



    2. copy file from folder to other folder.



    thanx

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Have you tried anything? We can fix that instead!

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    4
    I've tried to make a list but there was an error on "#include <dirent.h>"

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    What was the error did you get. Be more specfic on error messages which help us a lot on reply you. Was that the linking error, what compiler are u using and on what platform u are working on.

    ssharish2005

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    4
    the error was "Cannot open include file: 'dirent.h'"

    i'm working with MS visual studio 6.0

  6. #6
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    http://faq.cprogramming.com/cgi-bin/...&id=1044780608

    Choose one which your platform supports.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  7. #7
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Code:
    the error was "Cannot open include file: 'dirent.h'"
    Well looking at the error message, it seems that the direct.h header file is not located in the include director. Find out the actual location of the that header file and specify the path as approriate. The FAQ would give give more infomation about programming on windows platform.

    ssharish2005

  8. #8
    Registered User
    Join Date
    Jan 2007
    Posts
    4
    ok, thanx. sorry for my stupid questions

  9. #9
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    If your machine is not POSIX compliant, or at least mostly compliant, you are not likely to have dirent.h. You would find it under Linux or FreeBSD.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create Copies of Files
    By Kanshu in forum C++ Programming
    Replies: 13
    Last Post: 05-09-2009, 07:53 AM
  2. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  3. Error opening files in a different dir
    By Ozzie in forum C++ Programming
    Replies: 3
    Last Post: 10-09-2008, 06:55 AM
  4. Working with muliple source files
    By Swarvy in forum C++ Programming
    Replies: 1
    Last Post: 10-02-2008, 08:36 AM
  5. header and source files
    By gtriarhos in forum C Programming
    Replies: 3
    Last Post: 10-02-2005, 03:16 AM