Thread: Folder copy

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    13

    Folder copy

    Hello, I need your help. I want to copy a folder (C:\ABC) to D:\. How can I do that?

    Thanks,

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I don't know . . . how about system()?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    Could you specify it to me?

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    system() passes a string to the "shell" [sh/cmd] or whatever. Thus, like me on Windows, I would be able to say system("xcopy stuff A:\stuff"); This is probably system dependant, not portable, etc. Again, on Windows, you might use CreateDirectory[Ex] to um, create the directory and then walk through the source directory with repeated CopyFile[Ex]s to your newly create one. Again, this is a very system dependant thing, but I just mentioned the Windows cause you had C:\

  5. #5
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    Yes, I work under Windows with Borland. Is there any way to copy the folder directly?

    Thanks

  6. #6
    Programmer
    Join Date
    Aug 2005
    Location
    Ohio
    Posts
    8
    Just use
    Code:
    system ("copy c:\programs\firefox\firefox c:\windows")
    replce the filenames with yours, ok?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 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
  2. function to copy file from one folder to another
    By Harman in forum C Programming
    Replies: 7
    Last Post: 05-15-2005, 11:39 AM
  3. dynamic memory alloccation & returning objects
    By haditya in forum C++ Programming
    Replies: 8
    Last Post: 04-21-2005, 11:55 PM
  4. Copy Folder?
    By Antinaris in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2003, 06:59 AM
  5. Copy Constructor Help
    By Jubba in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2001, 11:15 AM