That's still a lot more work and error-prone than using garbage-collection.
Then with RAII you can clean up any kind of resource. Most languages have pretty rudimentary tools for closing files and worse for releasing mutexes. These tasks are almost easy to get right in modern C++.
int main() {
with_open_file_for_writing("foo.dat", [](FILE* fp) {
fprintf(fp, "old style I/O, automatically closed\n");
});
return 0;
}