Using FileManager to delete a directory?

How do I delete an entire directory? I can see how to delete files and how to create directories, but nothing in the docs seem to mention deleting a directory…

Thanks for your help!

Use the same function FileManager.remove. The docs doesn’t say anything about it, but it also removes the folders. It worked for me with the path [...]/Documents/a/nested/folder/ and folder got deleted.

1 Like

I suppose the folder has to be empty before it can removed?

I haven’t tried that.