1. Copy a Folder?
- Posted by dcole Jan 08, 2010
- 1591 views
Hello Everybody.
How do you copy a folder?
You don't have to walk_dir(} and copy every file do you?
Don Cole
2. Re: Copy a Folder?
- Posted by ArthurCrump Jan 08, 2010
- 1511 views
Hello Everybody.
How do you copy a folder?
You don't have to walk_dir(} and copy every file do you?
Don Cole
On Windows systems there is an API SHFileOperation or, on Vista, IFileOperation. I have tried to use SHFileOperation for another purpose. Success was mixed, so I don't feel confident to advise how to use it, so it is best to consult the instructions on the Microsoft developers' web site if you want to know more.
3. Re: Copy a Folder?
- Posted by alanjohnoxley Jan 12, 2010
- 1385 views
Maybe a simple workaround will do:
Use a compression program like ARJ or ZIP, called via system_exec to copy to a temp file, then extract that temp file at the desired target location, also by calling the compression program?
That will bypass possible system and hidden attribute bits issues too.
HTH!
REgards,
Alan
4. Re: Copy a Folder?
- Posted by alanjohnoxley Jan 12, 2010
- 1405 views
Something else you may need to watch for - certain files under Windows are locked, and uncopyable because Windows is holding them open.
For example NTUSER.DAT . With backup program I was working on, what I did was opened every file within the walk_dir, and then closed them again. Whatever could not be opened, obviously cannot be copied, and was added to an exclusion list.
5. Re: Copy a Folder?
- Posted by jimcbrown (admin) Jan 12, 2010
- 1377 views
Hello Everybody.
How do you copy a folder?
You don't have to walk_dir(} and copy every file do you?
Don Cole
Hmm, I guess you do. 4.0 has no copy_dir() function.
6. Re: Copy a Folder?
- Posted by lpuster Jan 18, 2010
- 1354 views
I have done this using recursive programming. It skips files that won't open, and restores all three date stamps on the copy (Windows NTFS partition). It also records a log of files copied and not copied, and why.