1

I am using FSEventStreamRef to register for file events on a particular directory. Does FSEventStreamRef guarantee that the order of events correspond to the order in which the changes are made to the File system?

For example

1) I create a new folder with name 'untitled folder' 2) I rename this newly created folder to 'MyFolder'

Can I safely assume that I would get 2 events (in the below order)

First corresponding to the new folder create having the file name as 'untitled folder' Second event with kFSEventStreamEventFlagItemRenamed flag set and having file Path as 'MyFolder'

Cœur
  • 37,241
  • 25
  • 195
  • 267
Prakhar
  • 11
  • 1
  • Maybe this answer is helpful? http://stackoverflow.com/a/20854586/210171 I posted some code there for using FSEvents. – nielsbot Dec 30 '14 at 10:21
  • I am able to use the FS Events API. It seems to be working fine. I am relying on order of events to detect if a file was renamed but could find no information if the API guarantees that the order of events is the same as the order in which actions take place on the file system. – Prakhar Dec 30 '14 at 11:09
  • The events are ORd together I believe--so you can't tell what happened first just from FSEvents. (See my linked answer) – nielsbot Dec 30 '14 at 11:30
  • I understand that when events are Ord together it is not possible to tell the order. But is it guaranteed that if there are two separate events they are delivered in the same order as the changes were made on the file system. In other words is the order preserved across events? – Prakhar Dec 30 '14 at 13:00
  • I don't know anything more, sorry. – nielsbot Dec 31 '14 at 00:09

0 Answers0