File bugs


If I have a file named 'Frozen_TLR-2-2D_F_5.1-720p-HDTN.wav' , File::getFileNameWithoutExtension yields 'Frozen_TLR-2-2D_F_5' and not 'Frozen_TLR-2-2D_F_5.1-720p-HDTN' as expected.

Same problem with File::withExtension. If "dat" is given as parameter, result is 'Frozen_TLR-2-2D_F_5.dat' and not 'Frozen_TLR-2-2D_F_5.1-720p-HDTN.dat' as expected.



Ps. This is on Windows.


Are you sure about that?

For me it works correctly.

And in the code, getFileNameWithoutExtension specifically goes up to the last dot in the string. Can't really see how this could fail to work for you..


Hehe... yeah ok, it works :) I just used it in a way that subtly didn't work as I expected:

File f("C:\\data\\Frozen_TLR-2-2D_F_5.1-720p-HDTN.wav");

String suffix("_tmp");

File f2 = f.getSiblingFile(f.getFileNameWithoutExtenstion() + suffix).withExtension("dat");

f2 == "C:\\data\\Frozen_TLR-2-2D_F_5.dat"

My bad.