Can't remove folders on windows

Hello guys, I encountered a bug where I am not able to remove folders on the documents directory using Windows. On Mac it always works.

I just created a folder with the name “abc” on the documents folder.

If I run the code below it will remove the folder but only on mac and not windows

os.remove( system.pathForFile( “abc”, system.DocumentsDirectory ) )

This only happens with folders. I did this with a txt, a json, and a zip file and it works.

Has anyone else encountered this bug? any solutions for this?

Try my file management code in SSKhttps://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/

Git: https://github.com/roaminggamer/SSK2

Files Modules: https://github.com/roaminggamer/SSK2/tree/master/ssk2/files

The equivalent call to what you wrote would be:

local path = ssk.files.documents.getPath( "abc" ) ssk.files.util.rmFolder( path )

Also, if you have any of the files in that folder in use, it may be locking the folder.

Windows 10 is a pain for that.

Generally, in cases where file/folder locking might occur, I defer deletions till the next start-up.

i.e. I track the files I want to remove, then remove them on the next start up.

Try my file management code in SSKhttps://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/files/

Git: https://github.com/roaminggamer/SSK2

Files Modules: https://github.com/roaminggamer/SSK2/tree/master/ssk2/files

The equivalent call to what you wrote would be:

local path = ssk.files.documents.getPath( "abc" ) ssk.files.util.rmFolder( path )

Also, if you have any of the files in that folder in use, it may be locking the folder.

Windows 10 is a pain for that.

Generally, in cases where file/folder locking might occur, I defer deletions till the next start-up.

i.e. I track the files I want to remove, then remove them on the next start up.