Skip to main content

I have a workbench with a scripted Parameter for a temporary folder. The python start up script creates it. The workbench does it's stuff and empties the folder. All this works fine; folder created, data moved to it, processed, then removed.

The shutdown script waits 5 seconds, then tries to delete the folder. I get an "[Error 5] Access is denied:" message (FME 2015 32 bit).

Can anyone help determine why this cannot be deleted, please?

@deadjo I am not sure exactly what is causing your error but if you are on Windows have you checked the Task Manager to see if Python is still running or if an instance of FME.exe is still active that should have automatically terminated after your job completed? If so try terminating those tasks and running again. Also have you tried increasing the script wait time before it executes the folder delete? 30 seconds or more might help if FME.exe is still accessing the folder as @revesz mentioned.

Can you delete the folder manually after the workspace finished (the Run button is green again)? If so, it may be because the actual path of fme.exe is still that folder.

My idea is to add a writer after the last one (or a featureWriter to the very end of the line if you use featureWriters) that writes something dummy to a different folder. (If it works you may delete the dummy file, too in the shutdown script.)


Hi @deadjo Do you have the rights to delete the folder? Try another location perhaps. Otherwize try to execute a second workspace after you move the files using the WorkspaceRunner transformer


Hi, and thank you for the responses. After wasting my time some more, I realised my rather stupid error. I was using os.remove() instead of os.rmdir(). (face palm) Thought I should share rather than disappear into the ether in embaressment.


Reason why it is always a good practice to share the workspaces and the codes. Glad you found your error.


Reply