Here is my file:
Here is proof of where the file is located:
Here's what I typed into the GNU Prologue console:
| ?- change_directory('C:/Users/Aidan/Desktop/Prolog practice').
yes
| ?- [hello_world].
Expected result:
compiling C:/Users/Aidan/Desktop/Prolog practice/hello_world.pl for byte code...
Actual result:
uncaught exception: error(existence_error(source_sink,'hello_world.pl'),consult/1)
I have tried different file names, different folders, using the "consult
" command, and using the absolute path instead of the filename. All result in the same error. Please help?
Windows native notepad is a simple text editor which tends to put
.txt
at the end of filenames. I suggest you to install another editor (e.g. notepad++).Under Windows, gpolog allows you to consult a file with the File|Consult menu option which allows you to select the wanted file in a file selector dialog box. Then it emits a
consult
showing the real filename (check if there is a.txt
a the end).You can obviously consult it with passing the full pathname:
It is however better to rename your file with the extension
.pl
(or.pro
). (The windows explorer has an option to hide known file extensions, maybe deactivate it to see full filenames including their extensions).BTW, gprolog does not handle well spaces in filenames. I suggest you to rename your
Prolog practice
directory asProlog-practice
.