Justin Goeres Posted September 11, 2009 Report Share Posted September 11, 2009 (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. 1 Quote Link to comment
ShaunR Posted September 11, 2009 Report Share Posted September 11, 2009 (edited) They are not phantom directories. They are shorthand for the current directory and the parent directory. Filenames, Paths and Namespaces If you type in "cd .." in a command prompt it will take you to the parent directory. If you allow "view hidden files" and "OS Files" and uncheck "Hide Known File Types"in the folder options you will also see them on the local drive.Its a throwback to DOS. Edited September 11, 2009 by ShaunR Quote Link to comment
Justin Goeres Posted September 11, 2009 Author Report Share Posted September 11, 2009 They are not phantom directories. They are shorthand for the current directory and the parent directory. I'm aware of that, but they're "phantom" in the sense that they shouldn't be returned by the List Folders operation (and aren't, except on network shares). That's the issue. Quote Link to comment
ShaunR Posted September 12, 2009 Report Share Posted September 12, 2009 I'm aware of that, but they're "phantom" in the sense that they shouldn't be returned by the List Folders operation (and aren't, except on network shares). That's the issue. Well. This is what I get when I follow your instructions. LV2009, Windows 7, LS-CHL NAS storage (don't know the versions off-hand but know its Samba on Linux). Quote Link to comment
Justin Goeres Posted September 12, 2009 Author Report Share Posted September 12, 2009 Well. This is what I get when I follow your instructions. Interesting. What happens when you do a dir in that directory from a Windows Command prompt (like in my third screenshot)? Do the $, !, and/or # files sort above . and .. like I saw? Quote Link to comment
ShaunR Posted September 12, 2009 Report Share Posted September 12, 2009 (edited) Nope. But I can get them above if i do Dir /on. Edited September 12, 2009 by ShaunR Quote Link to comment
crelf Posted September 12, 2009 Report Share Posted September 12, 2009 I don't know that I'd be exposing images of my torrents folder to the general public. Errr, that is if I had one... Quote Link to comment
ShaunR Posted September 12, 2009 Report Share Posted September 12, 2009 (edited) I don't know that I'd be exposing images of my torrents folder to the general public. Errr, that is if I had one... lol. Luckily I don't live in the USA. so am not paranoid. But now you have pointed it out in text, I know who to blame when it turns up of a search engine eh? Anyhoo, programmers have to install these nefarious clients so they can come up with software to defeat them....right? Your virus scanner would go ape on one of my machines. Edited September 12, 2009 by ShaunR Quote Link to comment
crelf Posted September 12, 2009 Report Share Posted September 12, 2009 But now you have pointed it out in text, I know who to blame when it turns up of a search engine eh? I sure hope your finger pointin' is limited to your own direction there buddy! Quote Link to comment
ShaunR Posted September 12, 2009 Report Share Posted September 12, 2009 I sure hope your finger pointin' is limited to your own direction there buddy! “It's not whether you win or lose, it's how you place the blame.” : Oscar Wilde Quote Link to comment
crelf Posted September 12, 2009 Report Share Posted September 12, 2009 “It's not whether you win or lose, it's how you place the blame.” : Oscar Wilde "It's not about who you know, it's about who you yes." : My mother 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.