On Sun, Jun 17, 2012 at 4:50 PM, Camillo Bruni
<camillobruni@gmail.com> wrote:
indeed this is a bit tricky... but what can you explicitely say :/
foo.tar
foo.tar.gz
foo.1.tar
foo.1.tar.gz
it's rather hard to decide which is the real extension and which one not :)
Why not
� � #('foo' 'foo.tar' 'foo.tar.gz' 'foo.1.tar' 'foo.1.tar.gz') collect: [:thing| thing extension] => #('' 'tar' 'gz' 'tar' 'gz')
and
� � #('foo' 'foo.tar' 'foo.tar.gz' 'foo.1.tar' 'foo.1.tar.gz') collect: [:thing| thing extensions] => #(#() #('tar') #('gz' 'tar') #('tar' '1') #('gz' 'tar' '1'))
or
� � #('foo' 'foo.tar' 'foo.tar.gz' 'foo.1.tar' 'foo.1.tar.gz') collect: [:thing| thing extensions] => #(#() #('tar') #('tar' 'gz') #('1' 'tar') #('1'�'tar'�'gz'))
?
foo.1.tar.gz is still (supposedly) gzipped data. foo.1.tar is still�(supposedly)�a tar file.
so it might make sense to define a couple of test cases to see what we want
(and maybe compare it to ruby / python / java)
maybe we can add at least an #extensions method returning a list or so.
If you check `man basename` you can pass explicitly an extension name to
be stripped away from the full basename. maybe that's a better strategy?
we should definitely find a solution for this!
On 2012-06-17, at 19:43, Guillermo Polito wrote:
> Hi!
>
> I've seen that FS takes as a file extension everything after the first dot,
> instead of the last one.
>
> Now, that conflicts with the naming we are using for our files:
>
> - changesets and fileouts often take the form something.cs, something.1.cs,
> something.2.cs
> - image names: pharo-2.0.image, pharo-2.0.1.image
>
> One of them has to be changed I think... :)
>
> Also, I'm more used to the other definition of extension: All after the
> last dot :S
>
> Guille
--
best,Eliot