Jump to content

Get config file PATH out of config file REFNUM ?


Recommended Posts

Hi !

It's probably quite easy but I didn't found out the solution to this question:

How to get the 'config file' PATH out of a 'config file' REFNUM ?

I first tried a 'Refnum to Path', this work for regular files, but not for config files (.ini).

I found out in post

http://forums.ni.com/ni/board/message?boar...d=343370#M35064

that "Config File refnums are not actual file refnum to the config file but a refnum to config data in memory but a refnum to config data in memory"

But I don't know how to access data in such data in memory..

Anyone knows ?

Charly

Link to comment

CITATION(spacecharly @ Apr 20 2007, 10:59 AM)

Hi !

It's probably quite easy but I didn't found out the solution to this question:

How to get the 'config file' PATH out of a 'config file' REFNUM ?

Hello,

There is a function for that : "refnum to path" to be found in "File I/IO" > "Advanced" > "Refnum to Path" at the bottom right, see screen shot below (LV 7.1) :

Link to comment

QUOTE(spacecharly @ Apr 20 2007, 07:40 PM)

I found a solution in using the 'Config Data Registry' VI, see attachment..

Yep - that's the way to do it. The config file refnum is a special refnum based on a GOOP repository, and the only way to get to it is the method you used - actually diving into the repository and getting access to the private method. I think that it's a private method for a reason: the config file VIs in vi.llb are meant to be an easy method of getting into the ini files, and encapsulating the file path keeps prying eyes from making changes to the file while the config VIs have got it open, so it's probably not something that should be public by default.

As an aside, the use of a repository under the config files VIs is a pretty good place to start if you're new to by-reference GOOP...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.