Although rB67e23b4b2967 turned the problem more recurrent, the warning messages in the console always appear when BKE_fluid_cache_free_all is called.
The warning messages are:
Unable to remove directory Unable to delete file Unable to remove directory Unable to delete file
Investigating the code, the problem is much more internal and occurs due to an apparent bug in BLI_filelist_dir_contents.
Inside this function, a "path" is created with file->path = BLI_strdupcat(dirname, dlink->name);
Note that BLI_strdupcat only joins names. So for the resulting path to actually exist, the dirname is required to end with a SEP '\\'.
But the BKE_fluid_cache_free code calls this function (inside BLI_delete) passing directories without the '\\' at the end.
This creates weird, non-existent directories.
In my case they are:
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\configconfig_0001.uni C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config.. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\datafluid_data_0001.vdb C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data.. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data.
But they should be:
C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\config_0001.uni C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\.. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\config\. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\fluid_data_0001.vdb C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\.. C:\Users\GERMANO\AppData\Local\Temp\blender_c20732\cache_fluid_4b85f272\data\.
Interestingly, just below, a more appropriate function for joining directories is called: BLI_join_dirfile (added to the function in rB65d6cecd68a2)
The solution in this patch is to simply copy the result of BLI_join_dirfile instead of calling BLI_strdupcat.