LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW locks unrelated files if you drag them over a LabVIEW window

Solved!
Go to solution

LV has a very annoying behavior where it sometimes locks files which are completely unrelated to it. Now I finally realized what causes this.

 

These specific steps have been run on Windows 7 with LV 2009, but I have seen this happen with other LV and Windows versions:

 

  1. Create a new VI.
  2. Open an Explorer window and find an MP3 file (I used the sample MP3 files in the My Music folder which ship with Windows).
  3. Open a media player program (double clicking one of the MP3 files should work and Windows Media Player works for the demonstration).
  4. Now, grab one of the other files and drag it into the Windows Media player window, but be sure to move the cursor through the LV window.
  5. Close the media player window and attempt to delete the file.
  6. Windows says the file is locked by LV, even though LV should not have touched it.

This video demonstrates this:

 

 

Unable to display content. Adobe Flash is required.

 

 

 

 

 

It looks like LV gets a drag enter message when the cursor passes over it and at that point it locks the file (looking at it again, I see that this happens even if you don't actually open the file). This doesn't happen with all file types, but I have seen it happen before with other files as well, and I'm assuming with these simple repro steps, someone on the LV team can figure out why and whether this can be fixed.


___________________
Try to take over the world!
Message 1 of 7
(4,114 Views)

Wow, that's annoying. Thanks for tracking it down to easily reproducible steps.

 

After your test procedure, you can actually close all open VIs until LabVIEW is at the welcome screen and the files are still locked. This is probably related to observations discussed elsewhere, that LabVIEW keeps unwarranted locks on some files until it is completely closed. I recently had a few temporary VIs open, closed them all to the welcome screen, but still was not able to delete the folder containing one of the files.

0 Kudos
Message 2 of 7
(4,096 Views)

Folders are usually less of an issue, because the folder is generally locked because it was one set as the working directory for the process. Setting another working directory (for instance, by doing a Save As) should free it up. Files are locked because LV holds open handles to them, which I don't see any good reason for.


___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(4,091 Views)

If I remember right it would not allow me to delete the folder because one or more if the files in it (not the folder itself) were locked by LabVIEW, even thought LabVIEW was at the welcome screen. Sorry, I did not invertigate in detail.

0 Kudos
Message 4 of 7
(4,087 Views)

This behavior has been filed as CAR 307595.

Message 5 of 7
(4,004 Views)
Solution
Accepted by topic author tst

The aforementioned CAR has now been closed as Duplicate.

 

The CAR that it was a duplicate of is closed as "Fixed in LV 2011". So now you have a reason to upgrade when August comes around. 🙂
(And we just reconfirmed that the bug is actually fixed using the exact steps to reproduce that are listed here.)

Message 6 of 7
(3,971 Views)

OK, so woohoo, I guess? Thanks.


___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(3,950 Views)