objective-cmacoscocoaxcode6file-forks

Check for resource fork in Objective C


How do i check whether a file exists with resource fork or not?

Note : With out using the API's of CarbonCore->Resources.h, Since they are deprecated.

I will be able to open the file where there exist resource fork or not. But i need to check whether the resource fork exists or not. This is what exactly i'm looking for.


Solution

  • Use getattrlist or fgetattrlist passing ATTR_FILE_RSRCLENGTH in the attrList parameter. see the man page for getattrlist.