-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference of paths between recursive and normal calls #43
Comments
I think this is meant to be a reflection of what happens in bash, etc. Given:
$ ls -l foo
total 3
-rw-r--r-- 8 alex staff 256 4 Oct 16:22 bar.txt
drwxr-xr-x 12 alex staff 384 8 Oct 11:52 baz $ ls -lR foo
total 3
-rw-r--r-- 8 alex staff 256 4 Oct 16:22 bar.txt
drwxr-xr-x 12 alex staff 384 8 Oct 11:52 baz
foo/baz:
total 2
-rw-r--r-- 1 alex staff 838 20 May 15:44 qux.txt In the second example the containing folder becomes part of the path - it prints That said, it'd certainly be simpler if it only worked one way, probably the second where the paths contain the |
* sanitises input to replace multiple slashes with single slashes * removes trailing slashes * uses `0` for padding when `link.depth` results in negative padding N.b will be resolved in a better way by ipfs/js-ipfs-unixfs-exporter#24
For info: We agreed that the depth will be calculated as using full path. Hence
returns
it will have depth 2. |
* sanitises input to replace multiple slashes with single slashes * removes trailing slashes * uses `0` for padding when `link.depth` results in negative padding N.b will be resolved in a better way by ipfs/js-ipfs-unixfs-exporter#24
* sanitises input to replace multiple slashes with single slashes * removes trailing slashes * uses `0` for padding when `link.depth` results in negative padding N.b will be resolved in a better way by ipfs/js-ipfs-unixfs-exporter#24
* sanitises input to replace multiple slashes with single slashes * removes trailing slashes * uses `0` for padding when `link.depth` results in negative padding N.b will be resolved in a better way by ipfs/js-ipfs-unixfs-exporter#24
As part of ipfs/js-ipfs#2540 I was digging why there are different
link.depth
whenipfs ls
is called recursively and non-recursively. I have tracked the inconsistency to how this exporter returns paths when called recursively and non-recursively.When called using
/ipfs/Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs
recursivelly, the result paths are:QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU/contact
QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU/about
When called using
/ipfs/Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs
non-recursivelly, the result paths are:Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs/contact
Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs/about
Eq. the original
/init-docs
is suddenly part of the returned paths.I believe there should be one way for both ways. What should be the right one?
The text was updated successfully, but these errors were encountered: