spacecharly Posted April 21, 2007 Report Share Posted April 21, 2007 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 Quote Link to comment
LAVA 1.0 Content Posted April 21, 2007 Report Share Posted April 21, 2007 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) : Quote Link to comment
spacecharly Posted April 21, 2007 Author Report Share Posted April 21, 2007 Thanks for your answer, but as I said, 'Refnum to Path' works for regular files, not for config files (.ini) I found a solution in using the 'Config Data Registry' VI, see attachment.. VoilĂ Quote Link to comment
crelf Posted April 21, 2007 Report Share Posted April 21, 2007 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... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.