File bugs


#1

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.

Regards

/Rob

Ps. This is on Windows.


#2

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..


#3

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.