LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String to path for Name inside library

Have found a strange behaviour, can you check if it is a bug, or it was a bug in LV2011.

I need to convert input string to a path and check if it is absolute path or relative. 

There is a problem when input string is a full name (including library):

library.lvlib:control.ctl 

when converted to path it is modified to:

library.lvlib:\control.ctl

Added "\" makes it very wrong and it is absolute path now.

path type bug.png

 

0 Kudos
Message 1 of 6
(2,332 Views)

@Alexander_Sobolev wrote:

Have found a strange behaviour, can you check if it is a bug, or it was a bug in LV2011.

I need to convert input string to a path and check if it is absolute path or relative. 

There is a problem when input string is a full name (including library):

library.lvlib:control.ctl 

when converted to path it is modified to:

library.lvlib:\control.ctl

Added "\" makes it very wrong and it is absolute path now.

path type bug.png

 


LabVIEW 2018 has the same result library.lvlib:\control.ctl

0 Kudos
Message 2 of 6
(2,306 Views)

You can add a backspace before the colon to make it relative. If that helps...

Certified LabVIEW Architect
Message 3 of 6
(2,285 Views)

Hi all,

 

I agree that this looks like erroneous behavior, but I'm not sure what the developers intended here so I'll need to check. In the meantime, an easy workaround would be to append ".\" to filepaths in the current directory.

 

Best,

 

Duncan Waldrop

Applications Engineer

National Instruments

0 Kudos
Message 4 of 6
(2,270 Views)

thols,

it would, but it is still absolute

path type bug.png

Are they just checking presence of a colon?

0 Kudos
Message 5 of 6
(2,259 Views)

@Alexander_Sobolev wrote:

thols,

it would, but it is still absolute


No, not if you just add a backslash directly before the colon. But if you add something else before the colon (like "\b") then yes.

 

I meant like: "library.lvlib\:control.ctl".

Certified LabVIEW Architect
Message 6 of 6
(2,243 Views)