i want to copy a directory from one drive to another drive. My selected directory contain many sub directories and files. How can i implement the same using vc++
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
The SHFileOperation() API function is the workhorse function for copying files. It supports recursing directories. Review the options available in the SHFILEOPSTRUCT structure to control the copy.
The hard way. copy every file individually.
Use
FindFirst()
andFindNext()
to iterate over the content of a directory UseSetCurrentDirectory()
to go in and out of directoriesUse
CreateDirectory()
to create the new folders treeand finally, use
CopyFile()
to copy the actual filesIf you have access to the boost library this is your friend:
http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm
Check the tutorial for nice examples using a filesystem iterator.
To get you started: