ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.03k stars 3k forks source link

Have symlinks referring to a valid CID get turned into a native link to that CID (as a file/folder) #9596

Open ShadowJonathan opened 1 year ago

ShadowJonathan commented 1 year ago

Checklist

Description

This may be a shot in the dark, but, when i've uploaded a few big files to my IPFS node, i realise that i want to rearrange some names and some other files in such a folder, but do not want kubo to have to have those files cached locally to "know" that they're duplicates, or a future kubo chunking change re-add the files again, under different blocks.

To be sure about this, I thought about the following; what if a symlink refers to a valid CID (which would become a broken symlink in linux), kubo would recognise that, and instead of adding a symlink, add a link to that CID/file as-if it was native?

This way, I can manipulate a folder full of large files with ease, not needing those to have downloaded locally, and be sure that kubo's chunking algorithm will not duplicate adding the folder.

Note: I am aware of MFS, but for this, I'd like to handle this through version control and/or backups, as that is a more transparent and reversible process for me at this point.

ShadowJonathan commented 1 year ago

In the end, for my use-case, I decided to use MFS with a stateful node to handle this, and to perform alterations manually, but I'd prefer if it were possible to transparently create a unixfs from a local dir with thus symlinks, a-la ipfs add.