samtupy / nvgt

The Nonvisual Gaming Toolkit

Home Page:https://nvgt.gg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delete Directory Issue

harrymkt opened this issue · comments

Hello. Simple, directory deletion is not working properly, especially on Linux system the server I am currently running.

Please note that this does not happen on Windows, even though they shared the same script.

Here is an example:

bool remove_map(string mapname)
{
return directory_delete("maps/"+mapname);
}

Am I doing wrong?

Thanks in advance!

Hi,

First I did find an issue with directory delete, the c++ function has a recursive boolean that controls whether the function should be deleted when empty, but I'd forgotten to register the boolean with Angelscript causing the argument to be set to a random value on function call! I'll push a commit to fix that and thus close this in a moment. In the mean time, a couple other things.

One common issue is case sensativity on unix filesystems.

If you have a folder called maps/Test, but then call directory_delete("maps/test"); that delete call will work on windows but not on unix.

Also make sure that the user you're running the script with has permission to delete the directory and the files inside it.

Other than that after testing this fix I'm about to push, please open another issue if the issue persists in another way.

Thanks!