OK. Starting from next release, we'll use the convention that the file
extension is the part after the last period of a basename.

Trevor Nash wrote:
> 
> Hussein Shafie wrote:
>> The file extension of "test.image.jpg" is considered to be "image.jpg"
>> and not "jpg". And, of course, "image.jpg" is an unsupported format.
>>
>> This seems stupid because, in your case, the file extension is obviously
>> "jpg". But in the general case, this is not always true. Example:
>> xxe-perso-4_1_0.tar.gz (the file extension is "tar.gz" and not "gz")
>>
>>   
> No, the extension is gz which tells you that this is a compressed file. 
> Because the file type tells you that there is another file within, then
> you can look at that extension and see that it is tar - so you have a
> compressed archive.
> 
> That may lead you to say that the extension is 'tar.gz' but this is
> imprecise and misleading because you can only say this because you know
> what the file types are (i.e. what the extension means).  Consider the
> equally sensible filename (in Unix at least) of xxe-perso-4.1.0.tar.gz. 
> Is the extension still tar.gz or 1.0.tar.gz?
>> Therefore, we are currently not 100% sure that this problem needs to fixed.
>>
>>
>>   
> In my own products I always treat the file extension as the part after
> the *last *period, not the first.  Given the above isn't this the only
> robust way to do it?
> 
> (Aside - I just looked in Windows at the file types, and though there
> are none with periods in you can add one.  I have not experimented to
> see if this actually works, especially in the case where the 'smaller'
> extension already exists - does it recognise x.tar.gz as gz or tar.gz? 
> But then experiments are a poor second to clear thinking when it comes
> to design IMHO.  It is certainly true that Windows recognises x.y.jpg as
> a JPEG file and not an unknown type.)
> 

Jean Jordan wrote:
> 
> Hussein Shafie wrote:
>> But in the general case, this is not always true. Example:
>> > xxe-perso-4_1_0.tar.gz (the file extension is "tar.gz" and not "gz")
> 
> I don't agree. A .tar.gz file has first been tarred and then been gzipped. For
>   gunzip xxe-perso-4_1_0.tar.gz
> the output will be xxe-perso-4_1_0.tar
> Then you can do
>   tar -xf xxe-perso-4_1_0.tar
> and the tarball will be unpacked.
> 
> 'tar -xzf' just does both steps for you.
> 
> Of course file extensions are merely convention, and you can mix them
> up as you want, but in this case we have two extensions, not a single
> dotted one.
> 


Reply via email to