In Chamilo 2 when deleting a course it deletes all the registries in the database.
But the files in var/upload/resource are still present.
It is good because resource could be used in many different courses.
So when deleting a course we should check if the resource_file that was used in a course do not have anymore resource_link associated to it then the resource_file registry should be deleted and the file on the disc as well to avoid living unused resources and files.