What is for an empty dot files generated on qcompiling

For each time qcompiling a file, say,
eh.pl, a new empty dot file, for example,

.eh.qlf.76122

is generated. What is the dot file for ?
I was surprised to happen to see so
many such empty dot files in emacs-dired buffer.
As far as I tested, it seems no problem to delete
them.

Is there a way for suppressing them ?

Kuniaki Mukai

Since some time, qcompiling eh.pl creates .eh.qlf.<PID> and only after successful completion moves this file to eh.qlf. On error it should remove the temporary file. This avoids incomplete .qlf files from being opened and thereby avoids crashes from concurrent creation and access to a .qlf file. I tried some trivial things to reproduce, but for me it all works fine.

jan

    March 27

Since some time, qcompiling eh.pl creates .eh.qlf.<PID> and only after successful completion moves this file to eh.qlf. On error it should remove the temporary file. This avoids incomplete .qlf files from being opened and thereby avoids crashes from concurrent creation and access to a .qlf file. I tried some trivial things to reproduce, but for me it all works fine.

Thanks Jan,

I see that such empty dot files should not be seen after successful

qcompiling. So there might be something wrong with

my qcompiling. I will try to find a correct use of qcompiling

for not seeing the qlf. files, though for now I

have no idea how to do.

Kuniaki Mukai

Hi Jan,

After reading the SWI manual on command line options,
I have managed to find a way for not generating the .eh.qlf. file
by relacing a line (A) with (B):

(A)
:- eh:scriptstart.

(B)
:- initialization(eh:scriptstart, main).

Although it works without generating the dot file, it
generates in stead a qsaved state. As I moved to qcompiling
from qsaved states, I am not satisfied with the current
workaround. Rather, it seems to me the genereated dot files should be
cleanup by the SWI compiler.

Kuniaki Mukai

Using :- eh:scripstart is not standard compliant, but in this case much worse, it causes the compilation of the file not to complete until scriptstart is finished. Now, I could guess you call halt/0 when your script is finished and thus compilation is never completed. So, always run your entry goal with initialization. ISO defines initialization/1. SWI-Prolog has more subtle ways as you have found :slight_smile:

I don’t really see what this has to do with qlf files vs. saved states.

I guess there should be a halt hook that cleans up incomplete qlf files.

Hi Jan,

I have found that the dot qlf files like
.eh.qlf.12345
do not appear, even for non terminating directive

:- eh:scriptstart.

As I agreed with your diagnostics, it is strange
that the trouble disappeared automatically.
I believe I did nothing special for such fixes.

Anyway, automatic qcompiling now seems works as I expected
naively without generating qsaved programs.

Thank you for diagnostics, from which I learned
much as always.

Kuniaki Mukai