hellik at web.de
Mon Mar 21 04:00:49 PDT 2016
> On 21-03-16 10:12, Paulo van Breugel wrote:
>> Hi devs,
>> In the addon r.forestfrag (python script), I used os.remove() to
>> remove some temporary files (in lines 230, 258 and 430). However, this
>> fails in Windows, with an error message like below:
>> WindowsError: [Error 32] The process cannot access the file because it
>> is being used by another process:
>> Removing these lines with os.remove() solves the problem, but than the
>> user is left with these temporary files. Is there a Window compatible
>> way to remove them in the script?
> Perhaps I should have looked harder first, the underlying problem
> (described here: https://www.logilab.org/blogentry/17873) seems to be
> that the file needs to be closed at OS level, which can be done using
in one of my addons  I'm also using os.remove() of an tempfile. the addon
works also on windows.
yes, closing the file should do it e.g. 
View this message in context: http://osgeo-org.1560.x6.nabble.com/os-remove-tp5257585p5257609.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
More information about the grass-dev