LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if the path exists and if not, create it

Calling GetFileAttrs on a file that does not exist is considered an error -- a non-existent file is considered an invalid input. Using this function to detect whether the file/dir exists is kind of a "creative use" of the function.

 

SetBreakOnLibraryErrors just turns on/off error popups and suspension ("breaking") for whenever any library function returns an error. Whether or not you call SetBreakOnLibraryErrors(0) first, your call to GetFileAttrs still returns an error. Calling SetBreakOnLibraryErrors(0) just turns the notification off.

 

You should remember to call SetBreakOnLibraryErrors again afterwards to turn it back on (assuming it was on in the first place).

Message 11 of 12
(1,281 Views)
Great explanation...
Now i got it.
Tnx a lot !
0 Kudos
Message 12 of 12
(1,277 Views)