Solved

Mac File Change Event

Posted on 2004-10-10
2
203 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

778 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