− printf(" %s (%s)", f->path, f->encoding);
− printf("\n");
− /* FIXME: f->contents is optional, how should we indicate this? */
+ struct filemetadata metadata = { 0 };
+ uint64_t start, end;
+
+ start = f->addname.newvertex.start;
+ end = f->addname.newvertex.end;
+ if (start == end) {
+ /* a directory */
+ } else {
+ read_filemetadata(&metadata, &contents[start], end - start);
+ }
+
+ printf(" %s (%s)\n", metadata.basename, metadata.encoding);
+ /* f->contents is presumably empty when either
+ * (a) the file is a directory, or (b) the new
+ * file is really empty. For now, assume it's
+ * present (it's an Option<Atom> though) and
+ * crash on dirs */