LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

check if file or folder

Your "compulsion" to demand an apology over a nearly 7-year-dormant thread is not a good look.

 

 

-Kevin P

0 Kudos
Message 21 of 23
(140 Views)

@gsloane wrote:

GerdW - you are "newbie shaming" for no reason. In fact BOTH of the below methods are correct. If as you say "You create a file path by using string constants. THAT'S PLAIN WRONG! Use path constants whenever you want to handle paths!" were in fact even remotely true, why would "String to Path" even exist? Yes, your way is more efficient and what a seasoned LabVIEW programmer might do; but shaming someone AND providing incorrect information in the process simply because they did something a different way than you think is correct is both inaccurate and unfair. Both ways work. You should apologize. I know this is an old thread, but I felt compelled to comment.

 

check.png


Both ways only work if you never intend to move to a different platform than Windows. With LabVIEW running on Windows, Linux, MacOS, Pharlap ETS, VxWorks and NI Linux RT and in the past also Sun Solaris and HP-Unix, and only with Windows and Pharlap ETS using the DOS naming scheme, it is valid to say that building paths by concatenating strings is the wrong way to do business!

 

The existence of the String to Path node is not a contraindication to this, but simply a helper function if you absolutely have to do it. But you need to be aware of the limitations when using this method. Just because you can hammer a nail in with a screwdriver doesn't mean that this is the way you should do it. If you have nothing else at hand, and absolutely definitely need to get this nail in without being able to get a hammer, then you can try to do it but don't wonder if the nail goes in badly and your screwdriver gets damaged!

Rolf Kalbermatter
Averna BV
Message 22 of 23
(130 Views)

@rolfk wrote:

 

 


Both ways only work if you never intend to move to a different platform than Windows. With LabVIEW running on Windows, Linux, MacOS, Pharlap ETS, VxWorks and NI Linux RT and in the past also Sun Solaris and HP-Unix, and only with Windows and Pharlap ETS using the DOS naming scheme, it is valid to say that building paths by concatenating strings is the wrong way to do business!

 

 


In fact, the OP was running on an sbRIO 9641... which means that this is specifically a case where the user wasn't using Windows, and should have been using path constants 🙂

0 Kudos
Message 23 of 23
(109 Views)