adam-p/s3-file-list-page

When a file and a directory have the same name, only the file appears

fred-wang opened this issue · 3 comments

Hi,

First, I would like to thank you for your little script, it's really useful!

I'm trying to use it to list S3 directories created by FuseOverAmazon. For some (technical, I assume) reason, this file system represents a directory by an empty file + an S3 directory which share the same name. Unfortunately, s3-file-list-page does not seem to handle this case and only list the empty file.

Acceptable fix for me would be either to list both the empty file and the directory or to list the directory only.

Thanks.

FYI, I solved my problem by ignoring empty files ($(contents[i]).find('Size').text() == '0').

That's great. I'm going to link to this from the Compatibility section of the README.

It seems that I spoke too quickly. A directory generated by FuseOverAmazon does not seem to be listed in the XML file, only the empty file with the same name is. I think I used the Amazon EC2 Web interface to move some directories previously created by FuseOverAmazon. This action seems to have made the directories visible in the XML file. It's unfortunate that FuseOverAmazon is not really compatible with other S3 tools (there exists a fork S3FS-C which seems to be compatible).

For the record, a correct fix is just to treat empty files as if they were directories.