LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

config file read key path: automatically convert to system format

I've just stumbled across a small hassle: using a config file to store a path causes some headaches down the road. When a Windows or Mac path is stored, it uses Linux encoding. When reading the path back in, it stays in Linux encoding. Attempting to use the strip path primitive results in the entire path being passed as the name output and "." being passed as the stripped path. This makes it difficult to use build/strip path when dealing with config file key paths and system constant or dialog paths.

 

System:

  • Windows 7 x64 Enterprise
  • LabVIEW 2011 SP1

Attached is a demo that shows the correct and mixed separators cases.

 

Is the intended operation of Read Key (path polymorph) to leave the path in Linux encoding? Most other path-input primitives seem OK with Linux encoding.

0 Kudos
Message 1 of 4
(2,933 Views)

How are you reading the config file?  The Key Read VI converts it back just fine.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,926 Views)

This is really strange: now I can't reproduce the origin of the bug. Probing the output from all of the associated read keys shows the path being correctly converted. I'm not sure how I could have gotten the string value instead of the path and converted it to a path object--without deliberately doing so.

0 Kudos
Message 3 of 4
(2,915 Views)

@Cranky wrote:

This is really strange: now I can't reproduce the origin of the bug. Probing the output from all of the associated read keys shows the path being correctly converted. I'm not sure how I could have gotten the string value instead of the path and converted it to a path object--without deliberately doing so.


you probably crossed the 8.6 - 2009 boundry at some point and got a depreciated 8.6 write to the config file at some point.

 

(Do not mix 8.6 or earlier and 2009 and later config file functions)


"Should be" isn't "Is" -Jay
Message 4 of 4
(2,903 Views)