LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy and Rename a folder

Solved!
Go to solution

Hi,

 

I have search through the forum. And I can't found proper solution, even this is a very simple problem.

 

I wanted to copy folder

 

D:\Projects PFA\Codes Dev\Testing\10112008\1606   to

D:\Projects PFA\Codes Dev\Testing\10112008\debug_1606

 

and I found the "copy" and "move" function tends to copy in this way

 

 D:\Projects PFA\Codes Dev\Testing\10112008\debug_1606\1606

 

I have attached the vi. Please help. 

0 Kudos
Message 1 of 11
(5,517 Views)

Hi,

 

         Read the detailed help of the Copy function. It tells if only the directory is specified it copies entire contents of it but if your specifying a path which contains files also you should specify with file extension.

Message 2 of 11
(5,509 Views)
Seems copy all contents inside a folder to another folder required some steps to go through.
0 Kudos
Message 3 of 11
(5,481 Views)

So I can conclude that to copy all contents in a folder, need to go through some extra stepss

 

It is not as easy as

 

copy c:\here\* d:\there

 

 

0 Kudos
Message 4 of 11
(5,472 Views)
Solution
Accepted by topic author engwei

engwei wrote:

So I can conclude that to copy all contents in a folder, ....


Don't "conclude". Read the online help. 🙂

 

If you want to copy the entire folder, you need to make sure that the new folder name does not exist. Don't create the destination folder, but delete it if it exists (careful! I would keep the confirm dialog).

 

 I would also strongly recommend to use path data type across everything. You constantly go back and forth between string and paths, really complicating the code.

 

Here's a quick draft that seems to do what you want.

 

Message Edited by altenbach on 11-13-2008 10:05 PM
Download All
Message 5 of 11
(5,461 Views)

altenbach wrote:

Don't "conclude". Read the online help. 🙂

Message Edited by altenbach on 11-13-2008 10:05 PM

 

Thanks for your help. It really do because I can't find the "online help" u hv mentioned. Even though "copy and rename folder" may sound easy for the expert like you, but for the newbies like me it may not sound as easy as "copy and rename folder".

 

Thanks again for your time and advise.  

0 Kudos
Message 6 of 11
(5,448 Views)

engwei wrote:

Thanks for your help. It really do because I can't find the "online help" u hv mentioned.


Simply right-click the copy icon and select "help". See if it works for you.

 

You can also find the entire "LabVIEW help" online, here's for example the help for copy.

 

(I agree you need to read it quite carefully, especially the "details" section at the bottom).

 

 

0 Kudos
Message 7 of 11
(5,443 Views)
I see. Thanks a lot.
0 Kudos
Message 8 of 11
(5,433 Views)

Hi could you post the CopyAndRenameFolderMOD.vi (11 KB) in version LabView 8.0

 

0 Kudos
Message 9 of 11
(5,275 Views)
0 Kudos
Message 10 of 11
(5,272 Views)