Closed aksun1 closed 8 years ago
As of current, I don't know of a way to know the directory of the executable. If the executable is clicked in Windows Explorer, or launched via a shortcut, the current directory should be the directory of the executable, and it should not be necessary to to chdir() anywhere to read a file in the same directory.
If launched via command line, or a shortcut with a modified starting directory, I'm not sure there's currently a way to know where the executable exists.
I'm trying to start the program through the explorer. What could be the reason it tries to open the config file from the temp directory then?
From the README:
I have these lines on top of my Ruby code, and tried multiple combinations but none of them have worked. I also have tried
--chdir-first
but it had no effect.I have a config file that is in the same directory than the exe created by Ocra. The file is loaded by this:
However, the file doesn't load from the same directory as wanted. The error, I think, tells it tries to load it from the temporary directory when the exe runs.
How can I get the script load the config.yml file from the same directory than the exe?