5 December 2010

Technical documentation quote of the day

From Apple’s File System Events Programming Guide, which tells you how to track notifications about changes on the Mac OS X file system:

If the number of events approaches 2^64, the event identifier will wrap around. When this happens, you will receive an event with the flag kFSEventStreamEventFlagEventIdsWrapped. Fortunately, at least in the near term, this is unlikely to occur in practice, as 64 bits allows enough room for about one event per eraser-sized region on the Earth’s surface (including water) and would require about 2000 exabytes (2 million million gigabytes) of storage to hold them all. However, you should still check for this flag and take appropriate action if you receive it.

Talk about designing for the long term. If I handled this event in my FSEvents code, I’d feel like I’d taken a long bet that my software will still be running many decades from now.