My current file structure is
url/demo/file.txt
url/demo(file without extension)
Now when I try to list the file without extension it using prefix demo it also list the files in folder demo
Is there a way to just list a single object with demo without fetching files in folder demo
Also wanted to understand why and how does AWS allows same file / folder at same level with same name. Azure and other File system gives a conflict error
Amazon S3 does not use folders. Instead, the
Key(filename) of objects includes the full path. So the first file is actually calledurl/demo/file.txtand the second one is calledurl/demo.While the user interface presents the concept of folders, they do no actually exist. For example, you could upload a file to that
demofolder without first creating the folder and the folder will magically appear. Then, if you delete the object, the folder will magically disappear (because it never actually existed).If you create a folder in the S3 management console, it will actually create a zero-length object with the same name as the folder. This will 'force' the folder to appear in the UI even though there are no objects with that Prefix.
You can list objects in the specific 'folder' by specifying a
delimiterand aprefix.