hi everyone!
am i allowed to pass closed file as argument for another function?

HERE THE EXAMPLE

int parse_obj_file(char *file_name, struct data *obj) {
    int status;
    FILE *file;
    char buffer[256];
    obj->count_of_vertexes = 0;
    obj->count_of_facets = 0;
    if ((file = fopen(file_name, "r")) == NULL) {
        printf("Ошибка: не удалось открыть файл\n");
        status = -1;
    } else {
        while (fgets(buffer, 256, file)) {
            if (strncmp(buffer, "v ", 2) == 0) { // сравнивает первые 2 симв
                obj->count_of_vertexes++;
            } else if (strncmp(buffer, "f ", 2) == 0) {
                obj->count_of_facets++;
            }
        }
        if (obj->count_of_vertexes == 0) {
            status = -1;
        }
        status = 1;
        fclose(file);
        
        allocate_memory_for_array_vertexes_in_facets(file_name, obj, status);
        return status;
    }
}