Release file created with the setLogFile() function

Asked by CDT on 2021-05-27

When using the setLogFile() function, the file is held by sikuli until the Sikuli IDE is closed, or another script is run.
Is there a way to force sikuli to release the file? Similar to the .close() function in Python?

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :

I have to check, but I do not think it is possible in the moment.

SikuliX version?

Revision history for this message
CDT (cobusdt) said (last edit ):

I'm on Version 2.0.4

This is my scenario:

At the start of the script I create a log dir, all assets are the written to this dir. Then at the end, I add the dir to an archive file, and remove the original.

The shutil.rmtree() function then fail, because the log file is still in use.

So I would like to close the connection before removing the directory.


Revision history for this message
TestMechanic (ndinev) said :

You need to use different approach since yours is not technically correct.

You can just archive file after sikuli script is done. So you can use shell or batch to do something like this:

sikuli -jar sikukli..... -r yourscript
7zip a .....
del ....

Can you help with this problem?

Provide an answer of your own, or ask CDT for more information if necessary.

To post a message you must log in.