1. Copy a Folder?

Hello Everybody.

How do you copy a folder?

You don't have to walk_dir(} and copy every file do you?

Don Cole

new topic     » topic index » view message » categorize

2. Re: Copy a Folder?

dcole said...

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Copy a Folder?

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: Copy a Folder?

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Copy a Folder?

dcole said...

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Copy a Folder?

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu