Reading Configuration Files
Posted: 05 Mar 2010, 11:21
I'm working on a BCI2000 application (3rd filter for the operator) that controls an external piece of hardware to present stimuli. The module for this external hardware has been tried and tested and it works.
The module allows the user to specify certain parameters in a text file, which I would like to read in with my BCI2000 Application. When trying to read this config file (stored in the same directory as the executable) an error message is presented that tells me the file cannot be found.
After some testing I found the problem, which has to do with the current working directory.
Ingredients:
- BCI2000 v3.0
- Operator
- gUSBampSource
- DummySignalProcessing
- CustomStimulusPresentation (derived from ApplicationBase (because StimulusPresentationTask already defined too many parameters))
When running the program and pressing the Set Config button, the operator gives me the error the file cannot be found. The working directory has been changed to the data storage location (BCI2000\data\Name00) instead of the directory of the executable (BCI2000\prog).
Why does the program change the working directory?
[Edit]And why doesn't it change it back
[/edit]
The module allows the user to specify certain parameters in a text file, which I would like to read in with my BCI2000 Application. When trying to read this config file (stored in the same directory as the executable) an error message is presented that tells me the file cannot be found.
After some testing I found the problem, which has to do with the current working directory.
Ingredients:
- BCI2000 v3.0
- Operator
- gUSBampSource
- DummySignalProcessing
- CustomStimulusPresentation (derived from ApplicationBase (because StimulusPresentationTask already defined too many parameters))
When running the program and pressing the Set Config button, the operator gives me the error the file cannot be found. The working directory has been changed to the data storage location (BCI2000\data\Name00) instead of the directory of the executable (BCI2000\prog).
Why does the program change the working directory?
[Edit]And why doesn't it change it back