Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5850149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:06:02+00:00 2026-05-22T13:06:02+00:00

I want to write an OSX (Snow Leopard) app that receives notifications when files

  • 0

I want to write an OSX (Snow Leopard) app that receives notifications when files within a specific directory are changed, and I want access to the path of the specific file that was changed.

I know I can do this using either File System Events or kqueue. The former doesn’t provide the details of which specific file changed (requiring me to build a snapshot of the directory I’m watching and then scan it to find out which file changed). The latter doesn’t support recursive watching (requiring me to recursively add watches to every file and directory within the parent directory).

I’ve had a look for libraries that handle the snapshot/recursion fun for me, but can’t find any. UKKQueue looks like a good wrapper for the low level kqueue stuff, but doesn’t seem to do recursion. Same for GTMFileSystemKQueue. SCEvents looks like a good wrapper for File System Events but doesn’t seem to handle finding out the specific file that changed.

Is there a library that does what I want and is suitable for an objc project for either of these technologies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:06:03+00:00Added an answer on May 22, 2026 at 1:06 pm

    I ended up using GTMFileSystemKQueue after I found out how easy it is to recursively iterate over a directory in objc:

    // Create a directory enumerator for the given top level directory
    NSDirectoryEnumerator *de = [[NSFileManager defaultManager] enumeratorAtPath:dir];
    
    // Add a kqueue on every file and folder below the top level
    NSString *file;
    while ((file = [de nextObject])) {
        [[GTMFileSystemKQueue alloc] initWithPath:[dir stringByAppendingString:file]
                                        forEvents:kGTMFileSystemKQueueAllEvents
                                    acrossReplace:YES
                                           target:self
                                           action:@selector(fileSystemKQueue:events:)];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We want to write a Windows/OS X app that sends podcast ratings info from
I am developing a program on OSX 10.6.4 (Snow Leopard), and I want to
I want to write a script that disable all the submit buttons when the
I want to write a template that returns me the smallest signed integer type
I want to write a test that calls a remote server and validates the
I want to write a program that uses the GPL-licensed pandoc for Markdown processing.
I am in Mac OSX, Cocoa . I want to read and write multi
I want to write a programme (in python) on Linux (Ubuntu Linux 9.10) that
Hey, I need to write a program for OSX that will cause my macbook
I have a directory (directory A) with 10,000 files in it. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.