Thread: Copying all files in a directory

  1. #1
    Registered User
    Join Date
    Aug 2008

    Copying all files in a directory

    Hi all,
    I need to write a C program to copy all files in a directory to another directory. Only the directory name will be specified as the source. Can anyone tell me how I should go about it? I will be doing it in Windows. Is there any way I can do this using only standard C functions and not any API's?

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    The FAQ answers all of your questions (including it being non-standard) :

  3. #3
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Well, the operation is OS based, I don't think there is a way to do that with only standard C, meaning being compatible in all systems.

    In windows there is MoveFile()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. copying files from a directory into another one
    By smoking81 in forum Linux Programming
    Replies: 7
    Last Post: 11-23-2008, 07:35 AM
  2. deleting all files in a directory using c..
    By ShadeS_07 in forum C Programming
    Replies: 6
    Last Post: 07-30-2008, 08:21 AM
  3. Replies: 4
    Last Post: 07-24-2008, 09:02 AM
  4. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  5. searching files in directory
    By lobo in forum Windows Programming
    Replies: 5
    Last Post: 10-05-2001, 03:00 AM