FolderItem.MacType

Hi!

I know that FolderItem.MacType is deprecated. But why?
There is a modern replacement available which works well (even on macOS 10.13):

Soft Declare Function NSHFSTypeOfFile Lib "Foundation"(path As CFStringRef) As CFStringRef Dim cocoTYPE As CFStringRef = NSHFSTypeOfFile(pXPVFile.NativePath)

Sometimes there is a need for an old TYPE instead of an Uniform Type Identifier.

Also FolderItem.MacCreator is not deprecated. This seems to be an error to act differently for TYPE and CREATOR…

Comments?

Deprecated doesn’t mean removed from Xojo. Apple have probably deprecated them since they stopped using them a decade ago.

Of course does Apple no longer use TYPE and CREATOR. But they are still part of the Finder-Info of a file (at least on HFS) and I need to access it from time to time.

Since I like to compile with no warning I replaced the FolderItem.MacType with the “NSHFSTypeOfFile” call. But I wonder if it is really necessary.

BTW: Is there another way to silence a deprecated warning?

Stay warned, in an upcoming version this is may be a syntax error.

That’s why I replaced it already in m code with “NSHFSTypeOfFile” :wink:

[quote]I know that FolderItem.MacType is deprecated. But why?
There is a modern replacement available which works well (even on macOS 10.13):[/quote]
They have been replaced with Universal Type Identifiers.

Note that your suggested replacement method NSHFSTypeOfFile contains “HFS”, it may not be functional on a system with APFS.