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 881499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:16:15+00:00 2026-05-15T12:16:15+00:00

I setup a FSEvent that runs well but it keeps reporting the same event

  • 0

I setup a FSEvent that runs well but it keeps reporting the same event each time I launch the app.

Ex:

My FSEvent monitor directory is:

Test/

…and there are three files:

test1, test2, test3

However, after I deleted test1 in my FSEvent Directory, it keeps telling me that test1 has been deleted every time I run the program instead of just the one time after the deletion.

I cleaned all managedObjects in my context and deleted the whole directory but the event keeps being reported.

What should I do such that it only tells me right after the deletion and then never again?

Thanks a lot!

  • 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-15T12:16:15+00:00Added an answer on May 15, 2026 at 12:16 pm

    File system event are persistent between launches. They are tracked by the file system itself, not the app. That is why you keep seeing the event every time you launch.

    I believe you have to call FSEventsPurgeEventsForDeviceUpToEventId or the like to clear the events.

    Take that with a grain of salt. I haven’t fiddled with it much.

    Edit:

    From File System Events Programming Guide:

    To work with persistent events, your
    application should regularly store the
    last event ID that it processes. Then,
    when it needs to go back and see what
    files have changed, it only needs to
    look at events that occurred after the
    last known event. To obtain all events
    since a particular event in the past,
    you pass the event ID in the sinceWhen
    argument to FSEventStreamCreate or
    FSEventStreamCreateRelativeToDevice.]
    [On a per-device basis, you can also
    easily use a timestamp to determine
    which events to include. To do this,
    you must first call
    FSEventsGetLastEventIdForDeviceBeforeTime
    to obtain the last event ID sinceWhen
    argument to
    FSEventStreamCreateRelativeToDevice.

    I think the important thing to remember is that the file system events are not actually stored or even related to app that is observing them. They exist independently of the app in the file system itself. In practice, several different apps could be set to observe the same event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Setup: I have two views that I need to respond to the touch event,
Setup error.sass is under app/assets/stylesheets I ran bundle exec rake assets:precompile error.css is in
SETUP : I have this app which has 4 activities in a linear path,
Setup I've attached an event to the 'window' object, and I would like to
Setup: ASP.net 3.5, Linq-to-Sql. Separate Web and DB servers (each 8-core, 8GB RAM). 4
Setup I have a website that draws RSS feeds and displays them on the
Setup: I have attached an event handler on the WebBrowser control something like this...
Setup In my MVC3 app, MembersController is decorated with an [Authorize] attribute. MembersController has
Setup: I have two trees of scripts that run on Oracle 11g - one
Setup data mkdir data echo -e 1\n2\n3\n4\n8\n4\n3\n6 > data/data.txt Launch Pig in local mode

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.