New file I/O function to identify working directory


Recommended Posts

My understanding so far is that DAQFactory uses its installation folder as 'home' - that is when referencing a file but without a path, it looks in the same folder daqfactory.exe is in. That's convenient for development but as soon as an instrument (.ctl) gets moved to a different folder or transferred to other machines, or if drive-mapping changes, etc, yada - basically if it's not stored in the install folder, then the explicit path has to be hardcoded in (yuck).

I'd really like to see a new file I/O function which returns a full string path to whichever directory the current .ctl file resides in. It could eliminate hardcoding full paths in favor of relative paths and provide users more flexibility in file I/O.

Link to comment
Share on other sites

  • 3 years later...

You can get this by using File.GetFilePathList(".")  It isn't fool proof. I've seen an instance of a mostly empty project where it returned the DAQFactory program directory even though the project was started somewhere else, but in most cases it will give you what you asked for.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.