• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cross-process file open notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross-process file open notifications


  • Subject: Re: cross-process file open notifications
  • From: James Bucanek <email@hidden>
  • Date: Mon, 8 Feb 2010 08:54:22 -0700

Alexander Cohen <mailto:email@hidden> wrote (Wednesday, February 3, 2010 2:50 PM -0500):

Is there any way in cocoa to get some sort of notifications when any process opens or closes any file? 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.

Alexander, I didn't see this thread until today and since it wasn't really answered, I'll add my two cents.


What you probably want is the kqueue()/kevent() family of BSD functions. It's not Cocoa, and programming it requires decoding typically dense/terse UNIX APIs, but it allows you to receive fine-grained notification of kernel events, including notifications of when a particular file/directory is opened, closed, or modified.

However, this still might not solve your problem. One of the hallmarks of frameworks/dylibs is that their code is only loaded once, and is then repeatedly mapped into the address space of multiple processes. So watching to see when the file is opened might not tell you if a process has loaded it, and it almost certainly won't tell you what process did the loading.

--
James Bucanek

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >cross-process file open notifications (From: Alexander Cohen <email@hidden>)

  • Prev by Date: Create a Quicktime-like window
  • Next by Date: Re: always show warnings?
  • Previous by thread: Re: cross-process file open notifications
  • Next by thread: IKImageBrowserView & IKImageView subclasses not getting called
  • Index(es):
    • Date
    • Thread