Calling playdate->file->unlink() on a file in the game's data directory, that we previously created with playdate->file->open(), will fail with playdate->file->geterr() reporting "permission denied".
I see this for all attempts to delete things, with or without recursive being set to true in unlink()
I don't think system permissions are a problem, as creating files works okay. And it's located in my windows user's Documents folder. Thanks for looking!
OK, this is working for me. That said, you need to make sure you close() the file before you try and unlink() it otherwise it will be reported as busy.
Ok I tried it again, and making a file and delete it does work. This does not though:
mkdir("foo");
unlink("foo", 1);
or
mkdir("foo");
unlink("foo", 0);
unlink() says it should work on a folder, at least when recursive is 1. It's not clear if it should work on an empty folder with recursive being 0:
Deletes the file at path . Returns 0 on success, or -1 in case of error. If recursive is 1 and the target path is a folder, this deletes everything inside the folder (including folders, folders inside those, and so on) as well as the folder itself.