+ file->path = file->fullpath + strlen(repo_path) + 1;
+
+ /* attempt to open the file */
+ if(!(fp = fopen(file->fullpath, "rb"))) {
+ fprintf(stderr, "repo_init: failed to open file: %s: %s\n", file->fullpath, strerror(errno));
+ free(file->fullpath);
+ return -1;
+ }
+
+ /* get size & modification time */
+ fstat(fileno(fp), &st);
+ file->size = st.st_size;
+ file->mtime = st.st_mtime;
+
+ /* calculate md5 checksum */
+ calc_chksum(fp, file->chksum);
+
+ fclose(fp);