Hello all,
I want to write a function that will get a current path and destination path and wil relocate an entire folder to the destination path.
I know how to move a file but not a folder that may contain subfolders as well.
any ideas?
Thanks
[SOLVED] relocate entire folder
Moderator: General Moderators
i presume there isn't a move dir function.
You will probably need to take the following steps.
Traverse the directory you want to move, and create a replica directory structure in your intended destination.
Whilst traversing and creating the directory structure, you'll need to list the files, and moves them as you come across them.
Mark
You will probably need to take the following steps.
Traverse the directory you want to move, and create a replica directory structure in your intended destination.
Whilst traversing and creating the directory structure, you'll need to list the files, and moves them as you come across them.
Mark
To move a folder and its subfolders, you could try (eg):
Seems to work ok for me under Win2K.
Code: Select all
system("move c:\\folder1\\folder3 c:\\folder3");