Yaniv Bouhadana Posted March 14, 2012 Report Share Posted March 14, 2012 Hello! I used the "Copy file" for copying an image file from a directory and everything runs OK, exept one problem - after closing the vi (and even LabVIEW) the "Thumbs.db" file which inside the folder stays "locked" - no rename ,move or deletion of this folder by windows is allowed! I know it make no sense but still this file stay locked! It released again when I copy another file from other directory and then the previous "Thumbs.db" file released. Did someone met this problem? Quote Link to comment
asbo Posted March 14, 2012 Report Share Posted March 14, 2012 LabVIEW is known to be a little greedy when it comes to file locks. For example: Cannot move or delete folder while LabVIEW is open. I use the utility Unlocker for deal with locking issues in general. As usual, the wise rolfk presents a Windows API-based solution using SetCurrentDirectory(), if you're up for it. 2 Quote Link to comment
Yaniv Bouhadana Posted March 15, 2012 Author Report Share Posted March 15, 2012 OK - I tried both solutions - the Unlocker is ok but its not a solution for a program which i develope to someone else use.. the other solution is nice - I implemented it and the only disadvantage of this solution is that for unlocking one folder you need to lock other and in this case i choose c:\windows - but it means that each time you use a common dialog file box in you program - the deafaut location will be c:\windows... Thanks again! LabVIEW Folder Unlocker.vi 1 Quote Link to comment
asbo Posted March 15, 2012 Report Share Posted March 15, 2012 Thanks for uploading the code! I'm glad you found something that worked, I'll store that away in case I need it someday. One workaround to the issue you mention is to do what was recommended in the thread I linked - store your actual working directory yourself and then use the API call before/after dialog calls to make everything place nice. Quote Link to comment
Yaniv Bouhadana Posted March 16, 2012 Author Report Share Posted March 16, 2012 I'll try it, but I'm afraid that the action of choosing a working directory itself, makes the directory to be locked. I'll try it when I'll have time and report as well.. Thanks again for the reference. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.