Anyone know what function will copy contents from one folder to another, I know the source folder and the destination aso I dont have to use the mkdir. Any Ideas?

Recommended Answers

All 2 Replies

Depends on operating system. If you are using MS-Windows, you can use win32 api function CopyFile() -- see MSDN for details. To my limited knowledge of *nix, I don't think *nix compilers have a similary function. You might also check the Boost libraries to see if it has a portable function. If not, then write your own or use systenm() function to use the system's cp or copy function.

Member Avatar

Depends on operating system. If you are using MS-Windows, you can use win32 api function CopyFile() -- see MSDN for details. To my limited knowledge of *nix, I don't think *nix compilers have a similary function. You might also check the Boost libraries to see if it has a portable function. If not, then write your own or use systenm() function to use the system's cp or copy function.

Shudn't B a problem if they're no sub directories in the folder. If there are recursion is ur friend.

U cud just use fstream and copy each file using binary to the other folder. :surprised

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.