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

ls yields both relative and absolute paths in the same request #755

Open
ewjoachim opened this issue Sep 4, 2024 · 0 comments
Open

ls yields both relative and absolute paths in the same request #755

ewjoachim opened this issue Sep 4, 2024 · 0 comments

Comments

@ewjoachim
Copy link

ewjoachim commented Sep 4, 2024

Thanks for the project <3

If I do:

$ touch foo
$ s5cmd cp foo s3://mybucket/a/b/c/foo
$ s5cmd cp foo s3://mybucket/a/b/c/foo/bar
$ s5cmd cp foo s3://mybucket/a/b/c/foobar

I'll get:

$ s5cmd ls s3://mybucket/a/b/c/foo
                                  DIR  foo/
2024/09/04 13:53:58                 0  a/b/c/foo
2024/09/04 13:54:39                 0  foobar

For some reason, while foo/ and foobar are shown with their relative path, foo's absolute path is shown. This makes automated processing of the output much harder.

Note

The behavior is the same if there's no file/folder ambiguity. If I only upload a single file, I get the same result: if I request ls <somepath>, and there is a file for which the path is exactly somepath, I'll get its absolute path, otherwise I'll get its relative path.

Fortunately, adding a wildcard makes the output much saner. (thankfully, I'm ok with recursive listing)

$ s5cmd ls s3://com.botify.saas.sandbox18.user.data/test/a/b/c/foo'*'

2024/09/04 13:53:58                 0  foo
2024/09/04 13:54:58                 0  foo/bar
2024/09/04 13:54:39                 0  foobar
$ s5cmd version  
v2.2.2-48f7e59

(by the way, it would be much easier to process if there was an option to get the fullname that didn't remove the size and mdate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant