+ // Copy the file pointer and work on that so we don't care if
+ // the calling function closes the file
+ int fd = fileno(f);
+
+ // Make a copy
+ fd = dup(fd);
+
+ // Retrieve a file pointer
+ db->file = fdopen(fd, "r");
+ if (!db->file)
+ return -errno;
+
+ int r = fseek(db->file, 0, SEEK_SET);