PDA

View Full Version : MACOS API to get to know Pakage info of a file.




imranpundeer
May 21, 2009, 03:01 AM
Hi All,
I am searching an API that can provide me that a particular file is a Package or not. Currently i am using NSWORKSPACE IsFlePackageAtPath API inside my deamon Application. But it is working fine on 10.5 MAC OS when used witihn my Deamon.

But when i m using the same API on MACOS 10.4 ppc, my deamon is restarting after using this API.

Please anybody know any other method for the same problem on MAC OS 10.4.
Any help would be appricated.



kainjow
May 21, 2009, 05:16 AM
Are you sure this is the actual problem? Have you looked at the crash report, and/or Console, to see why it's crashing? I have found several times that Tiger will crash often where Leopard will not, because Leopard is more forgiving.

But to answer your question, you can use LSCopyItemInfoForURL(), which gives you a LSItemInfoRecord and from there you can check its flags for kLSItemInfoIsPackage.

imranpundeer
May 21, 2009, 11:30 AM
Thanks a lot :)
It solve my problem.