Does prolog have built-in predicates, which can import and export complete files during runtime?
I need predicates like "assert" and "retract". The problem is that "assert" and "retract" only manipulates a dynamic list, not a complete file.
I know two ways of how to include a file into another:
:- include('file.pl').
:- consult('file.pl').
This mostly happens at the beginning of a code.
Can I use these predicates in the middle of my code? (I think the consult predicate worked, but I had problems with the include predicate...)
And is there any chance how to exclude/"delete" the included file again? (the more important question)
I found the built-in predicate "delete_file/1", which literally deletes the file (from your memory) - this is not what I wanted. But the file still was not deleted from the current program, only from the memory, which was really strange...
I hope someone can help me, because I could not find anything else than the predicates explained above. Thanks!!