Folderitem.extension change in 2024r1

Just trying to confirm that the behavior of folderitem.extension has changed in the latest version of xojo. We were previously using 2023r3.

If a file name is: SAMPLE.ABC

Previously, folderitem.extension return “.ABC” - note the period was included with the extension

In the current version of xojo, folderitem.extension returns “ABC” - note that no period is included

Was this in fact changed in 2024r1?

Have to make some changes in our application to accommodate this change, but before I do I want to make sure that this will not change back after being reported.

The release notes for 2024r1 says:

  • Every OS: Added FolderItem.Extension property to get/set the file extension of a file. (75378)

I guess that means is new for 2024r1.

Using 2023r4 autocomplete does not suggest .Extension
Using 2024r1 autocomplete suggests .Extension

Are you sure that your 2023r3 offers a folderitem.Extension?
Maybe you have code that adds folderitem.Extension to previous versions?

There are a number of packages that offer Extension as a FolderItem extension method. Are you sure you didn’t use one of those in the past version? For example MacOSLib.

1 Like

I’ve run the code unchanged in both 2023r3 and 2024r1 and I get errors in 2024r1. Have not changed any plugins or classes that extends Folderitem so I have to assume that it’s something that changed in this version of xojo.

I noticed this for FileType:

The file extension for the file type, or several extensions separated by semicolons, e.g., “jpg;jpeg”. A period before the file type is required on Windows, but is optional on other platforms.

As Alberto says, 2024r1 added an Extension method to FolderItem class for all platforms. If you were using an Extension method in 2023r3 then it must have been your own addition. The possible the new one doesn’t function the same as the old one?

Oops… you are correct. one of our other developers added an extension to the folderitem object and it returns the extension. Is there a way to make xojo use the extension instead of the one they now added to folderitem?

Yes, change the name of your extension method to say “MyExtension” and call that, rather than the built in one.