Thread: How to write a c program to copy the directory from one destination to other

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    3

    How to write a c program to copy the directory from one destination to other

    How to write a c program to copy the directory from one destination to other ....Without using the system() function...in linux...

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well you could start with reading the manual pages for
    - opendir
    - readdir
    - closedir

    Then for copying files, it would be
    - fopen
    - fread
    - fwrite
    - fclose
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    If you're feeling too lazy to write that yourself, you could check out the source for you system's cp utility. Possibly make a library version of it for use from your program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. I need the code of few programs in c++.plzzzzz help...plzzz
    By NAVINKR20 in forum C++ Programming
    Replies: 1
    Last Post: 05-08-2009, 09:13 AM
  3. Couple errors please help :-D
    By JJJIrish05 in forum C Programming
    Replies: 9
    Last Post: 03-06-2008, 02:54 AM
  4. Some humour...
    By Stan100 in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-06-2003, 10:25 PM
  5. open directory and copy files
    By 5n4k3 in forum C++ Programming
    Replies: 3
    Last Post: 08-06-2003, 09:49 AM