0
votes

I am trying to save rules and facts to a specific directory in my CLIPS programs.

(save "c:\tmp\rules.clp")

(save-facts "c:\tmp\facts1")

1- But it seems CLIPS disregards the path information. Since my windows username is not the owner of the CLIPS installation directory, the files are saved in a virtual store directory:

C:\Users\USERNAME\AppData\Local\VirtualStore\Program Files (x86)\CLIPS\Bin

2- If I run a system command and include the path, the same thing happens. The path is disregarded and the notepad cannot find the intended file.

(system "notepad c:\tmp\output.txt")

Is there a way to force these commands to save/read from a specific directory?

2

2 Answers

2
votes

CLIPS doesn't have the ability to override directory/files permissions set by the operating system. The path to the save/save-facts command is not modified before being passed to the system libraries for opening files (either fopen or fopen_s). I'd suggest changing the directory permissions if the user account you're using doesn't have write privileges.

0
votes

I think I have found the problem.

The paths should both be included in double quotes and the slashes should be converted into forward slashes.