I can't put any code into the dylib. It's library that's not being developed 
anymore but many users have it and use it. We have a new approach but the dylib 
has a sort of lock on some things we need. Because of this, we've decided to 
watch for usage of this dylib and when there is no usage, we can enable our new 
approach. As of now, all i can do is poll for new processes and run lsof on the 
to see what files they are using. I consider this approach very bad but i can't 
think of anything better.

AC

On Feb 3, 2010, at 5:28 PM, Jens Alfke wrote:

> 
> On Feb 3, 2010, at 1:50 PM, Alexander Cohen wrote:
> 
>> Is there any way in cocoa to get some sort of notifications when any process 
>> opens or closes any file?
> 
> I'm pretty sure there isn't. The rate at which those notifications were sent 
> would be pretty horrific (ever run fs_usage on all processes?) Even the 
> private file notification firehose that's consumed by Spotlight only tracks 
> modifications, not opening.
> 
>> The reason i need this is because i need to watch the system and do a 
>> certain task every time a particular dylib is loaded by an application.
> 
> Can you put code into the dylib itself that will do this? Like a +load method?
> 
> 
> On Feb 3, 2010, at 1:57 PM, Dave Carrigan wrote:
> 
>>> The FSEvents API is most likely what you're looking for.
>> Come to think of it, FSEvents might not tell you about files being opened, 
>> so it might not be exactly what you want, after all.
> 
> No, FSEvents notifies you when a particular directory (or anything inside it) 
> changes.
> 
> —Jens_______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40toomuchspace.com
> 
> This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to