# How to delete a Gurobi logfile

**URL:** <https://discourse.julialang.org/t/how-to-delete-a-gurobi-logfile/75292>\
**Category:** Optimization (Mathematical)\
**Tags:** question, gurobi\
**Created:** [January 27, 2022, 1:12pm UTC](https://discourse.julialang.org/t/how-to-delete-a-gurobi-logfile/75292 "2022-01-27T13:12:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian\_22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sebastian_22/32/33241_2.png) [@sebastian\_22](https://discourse.julialang.org/u/sebastian_22)\
**Post date:** [January 27, 2022, 1:12pm UTC](https://discourse.julialang.org/t/how-to-delete-a-gurobi-logfile/75292/1 "2022-01-27T13:12:12Z")

</div>

I have a model which runs multiple times with different input data. For each run I create a folder and place the Gurobi-Logfile within, by passing the Logfile-parameter to the optimizer after creating the model.  
After the model is solved I upload the results and the lofgile to a database at which point I would like to delete the created folder including the Gurobi-logfile. However, I get the following error:

IOError: unlink(“[…]\Gurobi\_log.txt”): resource busy or locked (EBUSY)

My question is how do I close the logfile?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 27, 2022, 10:07pm UTC](https://discourse.julialang.org/t/how-to-delete-a-gurobi-logfile/75292/2 "2022-01-27T22:07:40Z")

</div>

Following the Gurobi documentation: [https://www.gurobi.com/documentation/9.5/refman/logfile.html#parameter:LogFile](https://www.gurobi.com/documentation/9.5/refman/logfile.html#parameter:LogFile)

> Determines the name of the Gurobi log file. Modifying this parameter closes the current log file and opens the specified file. Use an empty string for no log file.

So I assume you just need to pass an empty string `""` as the new log file name before trying to delete the former.

If that doesn’t work:

How are you calling Gurobi?

Are you creating multiple models? Or re-using an environment?

---

<div class="post-metadata">

**Author:** ![sebastian\_22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sebastian_22/32/33241_2.png) [@sebastian\_22](https://discourse.julialang.org/u/sebastian_22)\
**Post date:** [January 28, 2022, 7:42am UTC](https://discourse.julialang.org/t/how-to-delete-a-gurobi-logfile/75292/3 "2022-01-28T07:42:46Z")

</div>

> So I assume you just need to pass an empty string `""` as the new log file name before trying to delete the former.

Sometimes the easiest solutions are hard to find 😃 Thank you very much!
