Jump to content

Folder copy... bad behavior?


Recommended Posts

This may be a bug, or may be just an "expected behavior". Given that it's not hard to reproduce, I suspect it's been seen before.

Reproduce:

1. In the Windows file system, create the folders C:\Original, C:\Original\Path1, and C:\Original\Path2.

2. Run the attached VI.

Expected either:

1. An error: the folder C:\Destination does not exist.

or

2. No error, and the folders C:\Destination\Path1 and C:\Destination\Path2 are created.

Actual result, no errors:

1. First iteration of the loop creates C:\Destination

2. Second iteration of the loop creates C:\Destination\Path2

Can anyone provide confirmation or insight?

Thanks,

Joe Z.

Link to comment

I've attached an image so those without LV8.6 can comment.

Looking at the built-in help docs for the copy function we read this:

QUOTE

For example, if you copy the directory c:\app to d:\app2, the function creates a new directory d:\app2 with the same contents as c:\app. The second time you copy the directory, the function creates a new subdirectory d:\app2\app and places the contents of app there. The third time you copy the directory, the function returns a Duplicate Path error.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.