I'm trying to create a directory in my temp / cache directory to store a file after downloading it but I seem to keep getting the Creation failed, path = 'xxxxx' (OS Error: Not a directory, errno = 20) error
createDirectory(String name) async {
final fileDir = await getTemporaryDirectory();
final Directory newFileDir = await Directory('${fileDir.path}/$name').create(recursive: true);
}
I tried getApplicationCacheDirectory() too but I got the same error but when I changed use getApplicationDocumentsDirectory(), it manage to create the directory without any error. Am I missing anything or is it not allowed to create a directory in the temp directory?