2

I've written a tool to create shapefiles using GDAL and am viewing the results in QGIS. Each time the tool runs, I want to create a new output directory*. I'm using QGIS 2.18.9 on Windows 10.

The problem is that, if I have viewed the previous result in QGIS, I cannot delete the output directory unless I close the whole application. Just removing the layer from the display isn't enough - there is still a lock on the directory. I don't want to close QGIS each time I run the tool. The browser panel doesn't seem to have a delete option, like ArcCatalog does, unless I'm missing something.

I have found that if I right click on the output directory and select Hide From Browser, I can run the tool again, but I don't know how to unhide it again. I have to click Add Layer and browse to the shapefile if I want to look at the output.

So the question is, how do I delete a folder, having viewed the contents in QGIS? I've used ArcGIS a lot, but I'm relatively new to QGIS. Is there a way to either delete the folder from within the browser or otherwise release it so I can delete it from elsewhere?

*This is by design - I want to put the onus on the user to make sure the output directory doesn't exist, rather than have the tool potentially delete existing data.

  • If you right-click the Favourites icon and select to Add a Directory..., it will open up browser dialog where you can delete folders. Not sure if there is another way to delete folders using the Browser Panel :) – Joseph Jun 27 '17 at 10:02
  • @Joseph clicking Add a Directory just adds the directory to the Browser Panel. I still can't delete anything. – jon_two Jun 28 '17 at 10:16
  • When you click Add a Directory and the window opens, you cannot right-click a folder and delete it? – Joseph Jun 28 '17 at 10:19
  • Oh, I see what you mean now - instead of selecting a directory to add, just use the windows dialog to delete the folder. This is just the same as using Windows Explorer to delete the folder though. – jon_two Jun 28 '17 at 13:45
  • Yes, that is what I meant. Don't think there is another way using the Browser Panel though... – Joseph Jun 28 '17 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.