LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recursive File List VI stuck in loop.

Solved!
Go to solution

Does anyone know if there is anything, such as a new security setting, in recent Windows 10 updates that might cause the Recursive File List VI to become stuck in a loop when certain files are in a folder?  Perhaps these files are being flagged as a potential security threat or something.  In my case, PDF files saved by a certain PC to our network drive are the cause.  When files saved from this one PC are in the folder, recursive file list gets stuck in an everlasting loop.  When I remove files saved from that PC, it works fine.  There doesn't seem to be anything wrong with the files.  If I manually navigate to the folder, they are visible, can be opened and all the contents are intact.  I don't see any security warnings in the properties window.  This only happens on newer Windows 10 machines.  Windows 7 machines aren't having the problem at all and some Windows 10 machines are also not doing it.  It just so happens that the PCs that are doing this are all fairly new.  Recent aggressive security policies at our company have bothered my software a number of times before and I am inclined to believe it is security related. 

0 Kudos
Message 1 of 19
(4,268 Views)

There is an input to that VI "Continue recursing on Error" that defaults to False.  Have you tried changing that to see if it will ignore those files? 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 19
(4,243 Views)
Solution
Accepted by topic author J.New
There are no errors, but I found the problem. If there is a file in the folder with a name that starts with a dash -, then the array of folder paths that stops the loop when empty continues to grow with duplicates of the folder path being added for each loop. The loop continues to run and the array will continue to grow forever. If I remove the dash from the file name, all is well. We have always had item numbers that start with dash that cause file names to start with a dash but I haven't seen this issue until newer PCs started coming in. Maybe a change in Windows is affecting how this VI runs. Oh well. I guess I will have to mod our software to remove the dashes.
Message 3 of 19
(4,226 Views)

Looks like a bug, but it is not obvious why this happens. Can we blame any specific part of the code? Do you see a fix?

0 Kudos
Message 4 of 19
(4,214 Views)

The List Folder VI is putting out two folder name array elements with dots in them.  It is causing the Build List of Folders case structure to be executed every loop.

0 Kudos
Message 5 of 19
(4,203 Views)

In the false structure, where the code is building a list of folders, I see a .. as a folder path.  It looks like its continually building a path to the folder one up. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 19
(4,200 Views)

Can you add a .. to the Folders to Exclude?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 19
(4,196 Views)

but what's so special about a dash? is this used as some kind of sentinel value? Is the bug in "list folder"?

 

It is possible to reduce the problem to a minimal example where, given a certain input, list folder produces an unexpected output?

0 Kudos
Message 8 of 19
(4,188 Views)

I just attempted it, but the Folders to Exclude function won't work because the Build Path VI is not building the dots into the path.  So it just keeps adding the same base path to the array.  

0 Kudos
Message 9 of 19
(4,182 Views)

https://forums.ni.com/t5/LabVIEW/List-Folder-Returns-Incorrect-Results-for-Folders-on-Network/td-p/9...

 

Same issue seen here.  Haven't read thru the full post yet.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 10 of 19
(4,177 Views)