I have a program that reads and writes a text file that exists in the same directory as the executable. To access that file, I call readFile "./file.txt"
This works when I run the executable from within the directory where it lives. However if i cd
to another directory and run the executable (it's on my path), Haskell tries to get the file.txt
from the working directory in my terminal. How do I make Haskell access the file.txt
from the location of the executable and not my working directory. I don't want to hardcode an absolute path because I want the executable to be somewhat portable.