Prolog - Finding the current directory, relative directory for 'tell' predicate
- by Bharat
I'm having trouble trying to figure out how to get prolog to spit out a text file where I want it to. I'm currently doing a bunch of operations and then using
tell('output.txt')
to record the output. Now the problem is that when I do this, it creates this file in the SWI \bin\ folder. I was wondering if there's a way to make it create this file in the directory containing the actual .pl file. So even if the file was moved (and it will be), the text file gets created right where the source file is.
Long story short, is there a way to get the location of the source file once the source file has been consulted?
Many Thanks!