[Kimchi-devel] [PATCH 3/3] issue #543: Generate unique vol names when downloading files with same name

Crístian Viana vianac at linux.vnet.ibm.com
Thu Dec 11 13:15:07 UTC 2014


On 11-12-2014 06:14, Royce Lv wrote:
> For filename like "imgzip.tar.gz", we will get prefix for "imgzip.tar" 
> and suffix ".gz"
> then name will be "imgzip.tar-clone-1.gz", because some image disk 
> image may be compressed for download.

* the new name would be "imgzip.tar-1.gz" :) The "-clone" tag isn't 
added in that case.

I agree that this is an "ugly" name, even though it solves the issue 
we're working on: not being able to download files with the same name. 
But what automatic rule can we use to generate a nice name for every 
file we download? Let's try it with "http://www.domain.com", 
"http://www.domain.com/foo", "http://www.domain.com/foo.zip", 
"http://www.domain.com/foo.tar.gz", 
"http://www.domain.com/foo.important.zip". It's hard to guess what the 
real extension is.

I was looking at the behaviour of browsers (e.g. Chrome, Firefox), and I 
noticed they add " (1)" to the file name when it already exists. We can 
do that as well, even though I don't think it's standard to how we've 
been naming things in Kimchi: "my-template-vm-1", "my-vm-clone-1". I 
think "my-vol.tar.gz (1)" would look out of place. How about 
"my-vol.tar.gz-1" and ignore file extension completely?

Do you have any other suggestion?




More information about the Kimchi-devel mailing list