This article is from the Mac Programming FAQ, by Jon Watte firstname.lastname@example.org with numerous contributions by others.
Well, it turns out that you can also find out whether an FSSpec is a
file or a folder by calling PBGetCatInfo and check bit 4 (0x10) of
ioFlAttr to see whether it is a folder. You may prefer to call
ResolveAliasFile for this instead.
You can also check the script of the file's title using PBGetCatInfo and
check the ioFlFndrXInfo field if you want to work with other script
systems than the Roman system.
Another common use is to find out how many items are in a folder; the
modification date of something or the correct capitalization of its name
(since the Mac file system is case independent BUT preserves the case
the user uses)