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

This is a discussion on How to write a c program to copy the directory from one destination to other within the Linux Programming forums, part of the Platform Specific Boards category; How to write a c program to copy the directory from one destination to other ....Without using the system() function...in ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,765
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,678
    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, 02: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, 10: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, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21