(crossposted to NI Forums)
I'm seeing a behavior where LabVIEW's List Folder primitive returns incorrect results for a folder on a mapped network drive, if the folder contains a file whose name starts with any of:
<space> ! # $ % & ( ) + , -
(I suspect it's actually any ASCII character whose value is less than or equal to 0x2D, but some of those are illegal and/or unprintable).
OS: WindowsXP
LV Version: LabVIEW 8.6 and LabVIEW 2009
Steps to Reproduce
(1) Map a network drive to a drive letter (I'm not sure that a mapped drive is necessary, and the network drive in this demonstration is a samba share from a Linux system).
(2) Create a file in a directory on the network share from #1, e.g. "Z:\list-folder-bug\file.txt".
(3) Note that LabVIEW's List Folder function returns correct results when listing the folder you just created.
(4) Rename the file you created in #2 above, changing its name to !file.txt. (The key is that the filename must start with !, or any of the other characters listed above.)
(5) Note that LabVIEW's List Folder function now returns two elements in folder names that don't really exist.
Why This Is Important
This is important because these phantom directories "." and ".." are expanded to "current directory" and "parent directory," which means LabVIEW thinks that the target directory contains a copy of itself and its parent. This produces an infinite recursion when listing directory contents recursively. In particular, the OpenG function List Directory Recursively is affected by this bug and enters an infinite loop when run on the directory shown in #5.
Bonus Information
Note, also that the dir command at the Windows Command Prompt sorts the file list in an odd way for files that begin with the aforementioned characters, but only on network shares.