How do I make a folder wrapping a bunch of existing CIDs?

I have a list of CIDs and Names and I want to make a [unixfs] root-folder that references all those CIDs by their names.

I can possibly hack this or workaround this (by re-adding etc) to obtain what I want but I’m left wondering if there is a more straightforward way to do this. Anyone has ideas?

I think you could script this using a combination of ipfs object new unixfs_dir and ipfs object patch add-link to add all of the existing CIDs under a fresh unixfs directory.

But I’m not 100% sure since I may not be able to scratch a PoC together anytime soon.

1 Like

@leerspace that’s perfect. I think that works. Exactly what I was looking for.

1 Like