I’m making a dataset more available with IPFS. The dataset is sorted by date, e.g. year. It looks like some entries have weird dates (e.g. 0000 instead of 2017), so I’ve removed them. However, it looks like the weird entries are still available on IPFS. How do I reflect the changes made in the directory so that the weird dates no longer show?
I’d say you just add the main directory to IPFS once again, just like you did the first time.
There will be no increase in repo size (blocks will be reused), but you will get a different hash than before.
This new listing will have updated subdirectory names.
You can also mirror the original added directory in the Files API:
ipfs files cp /ipfs/originalParentHash /myFolderName
Then, within the Files API, you list the directory contents with
ipfs files ls -l /myFolderName
and catch the ones you don’t want, e.g. with grep "0000"
, then remove all the unwanted files that you don’t want to have, or (better) move them to a kind of “outtakes” directory in the Files API. First:
ipfs files mkdir /myFolderName-outtakes
… then:
ipfs files mv /myFolderName/foo /myFolderName-outtakes/foo
.
Then run:
ipfs files ls -l | grep "^myFolderName" | awk '{print $2}'
which will print the new parent hash for the directory without the unwanted files.