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

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

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 ):
#2

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.

Thanks

Revision history for this message
TestMechanic (ndinev) said :
#3

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.