Re: Overly conservative result from FSEventsGetLastEventIdForDeviceBeforeTime()
Re: Overly conservative result from FSEventsGetLastEventIdForDeviceBeforeTime()
- Subject: Re: Overly conservative result from FSEventsGetLastEventIdForDeviceBeforeTime()
- From: James Bucanek <email@hidden>
- Date: Fri, 28 Mar 2008 12:38:06 -0700
I wrote a stand-alone test program to demonstrate this problem.
Basically, I take an NSDate and convert it to an CFAbsoluteTime
using -[NSDate timeIntervalSinceReferenceDate], then pass that
to FSEventsGetLastEventIdForDeviceBeforeTime(). No matter what
date I pick or what volume I choose, the value returned is a
really, really, small event ID. As far as I can tell, it's about
the smallest event ID for that device. And the event ID is
always the same (per-device). When the FSEventStream starts it
replays every event for that device since the beginning of time.
I've tested on PPC & Intel, and on internal and external drives.
I can't imagine what I'm doing wrong, but it's also hard to
imagine that FSEventsGetLastEventIdForDeviceBeforeTime() is
completely broken.
If someone has any insight on this, I'm anxious to find out. I
also have the test application if anyone wants to play with it.
James
James Bucanek <mailto:email@hidden> wrote (Thursday,
March 27, 2008 12:38 PM -0700):
Hi,
I'm calling FSEventsGetLastEventIdForDeviceBeforeTime() to get the sinceWhen event id for a new file system events stream.
My problem is that the value returned is very small and I'm
getting really old events. For example, the time I passed in
for my latest test was about 10 minutes ago (NSDate=2008-03-27
11:42:40). The starting ID returned by
FSEventsGetLastEventIdForDeviceBeforeTime() was 147,036. Using
that value to create the event stream delivers events that are
weeks, even months, old. The latest event number on this device
is 13,037,960.
I was worried that I might have the time base wrong. But
FSEventsGetLastEventIdForDeviceBeforeTime says it takes a
CFAbsoluteTime, which is the number of seconds since 1/1/2001.
I'm passing in an -[NSDate timeIntervalSinceReferenceDate]
which should also be the number of seconds since 1/1/2001.
In fact, I just went back and tested it a couple of more times and no matter what date I pass it, it returns 147,036.
Am I missing something?
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden