Mike Le Posted May 6, 2013 Report Share Posted May 6, 2013 (edited) Perhaps my definition of "exists" is subtly different than the typical OpenG developer/user, but I had the expectation that an empty path input would return false. I find that in most situations where I want to check if a path exists, I'm about to perform a file operation that also requires that path to be non-empty. I don't think I'd ever use the "File Exists" primitive without also calling the "Empty Path/String?" primitive. Edited May 6, 2013 by Mike Le Quote Link to comment
Jim Kring Posted May 6, 2013 Report Share Posted May 6, 2013 Perhaps my definition of "exists" is subtly different than the typical OpenG developer/user, but I had the expectation that an empty path input would return false.I find that in most situations where I want to check if a path exists, I'm about to perform a file operation that also requires that path to be non-empty. I don't think I'd ever use the "File Exists" primitive without also calling the "Empty Path/String?" primitive. Empty path is actually not empty on Linux, it's "/" or the root directory. On Windows and Mac, if you list the contents of empty path, it lists all the drives on the computer. So, this isn't really an OpenG definition, as much as it is a LabVIEW definition. I hope that helps. Quote Link to comment
hooovahh Posted May 6, 2013 Report Share Posted May 6, 2013 I had a similar complaint (without knowing the platform issues) so I have made a small VI that is called "Is Path Valid and Exists?" which uses the two OpenG VIs "File Exists" and "Valid Path". I never just use the "Valid Path" anymore. You could do something similar where it needs to be "Valid Path", and Not "Empty String/Path" Quote Link to comment
Mike Le Posted May 6, 2013 Author Report Share Posted May 6, 2013 Thanks for the background info, Jim. I had a similar complaint (without knowing the platform issues) so I have made a small VI that is called "Is Path Valid and Exists?" which uses the two OpenG VIs "File Exists" and "Valid Path". I never just use the "Valid Path" anymore. You could do something similar where it needs to be "Valid Path", and Not "Empty String/Path" Yes, this is exactly what I'll be doing. Thanks. Quote Link to comment
Elset Posted May 7, 2013 Report Share Posted May 7, 2013 FYI Discussion continues on the next page of that thread as well. 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.