Hi

I have a file

/Users/ducasse/PharoMooc/Subtitles/W1/C019SD-W1-sous-titres-EN/EN_C019SD-W1-S1.srt

and I would like to generate a new one with a different extension

/Users/ducasse/PharoMooc/Subtitles/W1/C019SD-W1-sous-titres-EN/EN_C019SD-W1-S1.vtt

Now I'm browsing FileReference and I do not find an easy way to do it.


I had to peek and poke to get

    (self parent / self basenameWithoutExtension) withExtension: 'vtt'


I analyse a bit why I was slow discovering it:



    I did not really find a nice way to obtain

/Users/ducasse/PharoMooc/Subtitles/W1/C019SD-W1-sous-titres-EN/

or

/Users/ducasse/PharoMooc/Subtitles/W1/C019SD-W1-sous-titres-EN/EN_C019SD-W1-S1


Proposal one:

    We could add withoutExtension

    withoutExtension

           ^  (self parent / self basenameWithoutExtension)


Proposal two:

    We could add withoutBasename

    withoutBasename

            ^ self parent


Proposal three:

Not sure that it is worth

(note that this is not a rename)

    withNewExtension: anExtension
^ self parent / self basenameWithoutExtension withExtension: anExtension

So what do you think?

Stef




Reply via email to