How to list the files inside a Folder in the bucket using UplinkCLI

Hello,

I created a Bucket and then created a Folder inside the Bucket, and add a file inside the Folder.
But when I try to list teh file using the ls command in the Uplink CLI, nothing shows up.

.\uplink ls sj://Demo-Bucket/Test Folder/

But, If I create a Folder name without Space eg: Test-Folder
then the same command works fine with the files inside folder.
.\uplink ls sj://Demo-Bucket/Test-Folder/

So, How do we list the files if the Folder has a SPACE in it like “Test Folder”.

Thanks

Okay, You can close this thread, I found the answer.
Just for others with same problem, here is the solution, use Single Quotation marks on the Folder name with space.

Eg:
.\uplink ls sj://Demo-Bucket/‘Test Folder’/

1 Like

Few things.

  • you can quote entire thing instead, much easier:

    ./uplink ls 'sj://Demo-Bucket/Test Folder'
    

    Quoting prevents argument splitting at a white space: without it you are passing three arguments to uplink: ls, sj://Demo-Bucket/Test, and Folder. This is not specific to storj in any way. You can read more here: WordSplitting - Greg's Wiki

  • you can’t “create a folder” in a bucket. Buckets don’t have hierarchical structure, they are plain single level collection of objects. The / separator is just part of the object name, not a “directory”. Some software interprets those separators as path separators and manufactures the hierarchical fictitious representation for you.

    In most cases it does not matter, but it may matter in some; it’s best to think correctly about how this works.

3 Likes