Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

.cat subfiles #478

Closed
victorb opened this issue Sep 12, 2016 · 8 comments
Closed

.cat subfiles #478

victorb opened this issue Sep 12, 2016 · 8 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@victorb
Copy link
Member

victorb commented Sep 12, 2016

From #476, cannot .cat files that lives inside directories, example:

node src/cli/bin.js files cat /ipfs/QmegvLXxpVKiZ4b57Xs1syfBVRd8CbucVHAp7KpLQdGieC/readme

Shows no output

@victorb victorb added the kind/bug A bug in existing code (including security flaws) label Sep 12, 2016
@victorb
Copy link
Member Author

victorb commented Sep 12, 2016

@dignifiedquire @diasdavid would a valid approach be to first check if the path contains a subfile, and if so, do .ls and grab the hash for the file and pass that to the dag-service within core.cat?

@dignifiedquire
Copy link
Member

I would suggest doing the same thing as go-ipfs, i.e. implementing a core function resolve, which when given an ipfs path, returns the hash of that path.
Under the hood this would use https://github.com/ipfs/go-ipfs/blob/master/path/resolver.go to resolve through.

@dignifiedquire
Copy link
Member

This will also make it easy to add CIDs to the resolution everywhere + ipns once we add it.

@daviddias
Copy link
Member

@victorbjelkholm it might be good to have that resolver in its own module, so that given an source of merkle-dag nodes, it can resolve anything

@daviddias
Copy link
Member

How is this one going?

@victorb
Copy link
Member Author

victorb commented Oct 31, 2016

@diasdavid I remember it was mentioned that this was only written (the resolve) but I cannot find out where to integrate it, any ideas?

@daviddias
Copy link
Member

You get the resolve from IPLD resolver, but you also have to integrate it on unixfs-engine, a IPLD Path only goes to the "root dag node of the file", then you have to fetch the leafs

@daviddias
Copy link
Member

adding this one to be tracked on #60

@daviddias daviddias removed the status/ready Ready to be worked label Dec 5, 2016
MicrowaveDev pushed a commit to galtproject/js-ipfs that referenced this issue May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants