Ваш фрагмент кода работает нормально для меня.Флаги меток и искателей не изменены.
g5:fileinfotest toby$ touch the-file
g5:fileinfotest toby$ GetFileInfo the-file
file: "/Volumes/data/Users/toby/Documents/workspace/fileinfotest/the-file"
type: ""
creator: ""
attributes: avbstclinmedz
created: 02/23/2011 14:29:15
modified: 02/23/2011 14:29:15
g5:fileinfotest toby$ ./build/Debug/fileinfotest.app/Contents/MacOS/fileinfotest
g5:fileinfotest toby$ GetFileInfo the-file
file: "/Volumes/data/Users/toby/Documents/workspace/fileinfotest/the-file"
type: "EFGh"
creator: "ABCd"
attributes: avbstclinmedz
created: 02/23/2011 14:29:15
modified: 02/23/2011 14:29:15
Код:
FSCatalogInfo catInfo;
FSRef ref;
if(!FSPathMakeRef (
"/Volumes/data/Users/toby/Documents/workspace/fileinfotest/the-file",
&ref,
false
))
{
FSGetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL);
FileInfo *info = (FileInfo*)catInfo.finderInfo;
info->fileCreator = 'ABCd';
info->fileType = 'EFGh';
FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catInfo);
}