Solved

Mac File Change Event

Posted on 2004-10-10
2
192 Views
Last Modified: 2013-12-26
Does OS X have an easy OS hook to detect file changes in the filesystem?

What I need is a way to detect when a user writes to a filesystem in real time - as you might have in a virus scanner that needs to scan any changes that get written to the filesystem.

0
Comment
Question by:rcovington
2 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 500 total points
ID: 12273153
The File Notification APIs deal with this, specifically FNSubscribe() and FNSubscribeByPath() in File.h:
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/file_manager/function_group_48.html

0
 

Author Comment

by:rcovington
ID: 12375055
Thanks!  That gave me a starting point to solve my issue. For anyone else going down this road, in addition to FNSubscribe, OS X has the kqueue interface which also provides some of this information.

Thanks for the quick response.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now