Skip to content
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

List endpoint only works on directories #699

Closed
stewartie4 opened this issue May 27, 2022 · 2 comments · Fixed by #730, 0chain/zboxcli#267 or 0chain/system_test#306
Closed

List endpoint only works on directories #699

stewartie4 opened this issue May 27, 2022 · 2 comments · Fixed by #730, 0chain/zboxcli#267 or 0chain/system_test#306
Assignees
Labels
enhancement New feature or request

Comments

@stewartie4
Copy link
Contributor

stewartie4 commented May 27, 2022

When calling list with a filepath pointing to a file, an empty result is always returned.
However calling list with a filepath pointing to directory, the results are returned as expected

Is list only intended for directories (as opposed to the ls command in unix which supports files and directories for example)

If so, this needs to be made clear as it is confusing as-is

@stewartie4 stewartie4 added the enhancement New feature or request label May 27, 2022
@avanaur
Copy link
Contributor

avanaur commented Jun 14, 2022

@peterlimg @cnlangzi should we support non-directory on zbox list? I am thinking no and we can simply indicate on zbox list that it expects the --remotePath provided is a folder and will try to list contents. Same for --authticket param.

./zbox list --help
list files from blobbers

Usage:
  zbox list [flags]

Flags:
      --allocation string   Allocation ID
      --authticket string   Auth ticket fot the file to download if you dont own it
  -h, --help                help for list
      --json                pass this option to print response as json data
      --lookuphash string   The remote lookuphash of the object retrieved from the list
      --remotepath string   Remote path to list from

If there are no concerns, I'll raise a PR to update the list description and the description of the params mentioned.

@peterlimg
Copy link
Member

@avanaur I think we need to return the file if the remotePath points to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants