LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying error when copying project directory

I'm having problems copying a project directory if I have the project open in CVI.  If I try to copy the project (just using Windows Explorer, for example to another drive or to a mapped network location), I always get an error from Windows along the lines of:
"Cannot copy i386-mswin32-release: It is being used by another person or program.
Close any programs that might be using the file and try again."

It looks like CVI has a lock on something whenever it is open which prevents me from copying, which appears to have something to do with the .pch files in the cvibuild directories.  Is there any way around this so that I don't have to completely shut down CVI to make a backup of what I'm working on?  I'm using CVI 9.0.1, I don't recall running into this in previous versions of CVI.  Thanks in advance!

0 Kudos
Message 1 of 6
(3,498 Views)
It your goal is to backup your work, you should not need to copy neither the cvibuild directory nor the dbg files, as they retain dynamic informations that are rebuilt every time you run the project.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(3,487 Views)

tstanley:

 

I can duplicate your problem using CVI 9.01 and Windows XP Pro when I use precompiled headers.

 

I can copy a project directory with no problem if I don't use precompiled headers, but when I select Options >> Build Options >> Compile with precompiled include file, I get the same error.

 

However, the error goes away when I do the following:

Options >> Build Options, uncheck Compile with precompiled include file, click OK, then go back to Options >> Build Options, check Compile with precompiled include file, and click OK.

Somehow by checking Compile with precompiled include file (and clicking OK) and then going right back and checking Compile with precompiled include file (and clicking OK) I can now copy with no errors.

 

I tried this with a couple of projects that weren't originally set to use precompiled include files.  When I first set it to use precompiled files, I get the error.  After I uncheck it and then recheck it, I don't get the error.  I don't know why.

 

Does that work for you?

Message 3 of 6
(3,486 Views)

tstanley and Al,

 

I was also able to reproduce this issue and I'll be working with our developers to figure out what the problem is and see if a bug report needs to be filed.  Tstanley, if you apply the same workaround that Al suggested (of unchecking "Compile with precompiled include file", clicking OK, then rechecking it) does this also get around the issue you are seeing?  It did so for me, but I just wanted to confirm that you were able to copy the directory after this workaround as well.

Eric B.
National Instruments
0 Kudos
Message 4 of 6
(3,459 Views)
Thanks everyone for looking into this.  My project does have the precompiled headers option enabled, and disabling this option, pushing OK, then re-enabling the option does allow me to successfully copy the project directory.  It seems to work even with debugger running, though I have to suspend the debugee to get access to the build options.  For now, I'll just do this.  The other option of simply not copying the cvibuild directories also works.
Message Edited by tstanley on 10-27-2009 02:11 PM
0 Kudos
Message 5 of 6
(3,451 Views)

tstanley,

 

 I found that the reason this file is locked down is because the development environment has a hold on that file for updating it when you update your code.  Unchecking the box which disables the precompiled headers option releases that lock and checking it again doesn't lock the file again right away.  So this is expected behavior and either of the options presented (unchecking/checking the option before copying, or just not copying the output directory) should do what you need.

Eric B.
National Instruments
0 Kudos
Message 6 of 6
(3,423 Views)