# US 2001/0025285 A1 · System and method for interfacing index based and iterator based application programming interfaces

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2001/0025285 A1
- Document ID: US20010025285A1
- Status: Published application
- Kind: A1
- Application number: 09/866,116
- Filed: 2001-05-25
- Published: 2001-09-27
- Earliest claimed: 1998-12-17
- Assignees: Apple Computer, Inc.
- Inventors: Mark S. Day; Donald J. Brady; Deric S. Horn
- Web page: https://patentgrep.com/patent/US20010025285A1

## CPC

- G06F 16/13: File access structures, e.g. distributed indices (arrangements of input from, or output to, record carriers G06F3/06)
- Y10S 707/99933: Query processing, i.e. searching
- Y10S 707/99934: Query formulation, input preparation, or translation
- Y10S 707/99935: Query augmenting and refining, e.g. inexact access
- Y10S 707/99943: Generating database or data structure, e.g. via user interface
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A system and method for interfacing index based and iterator based file management routines. In general, the disclosed system maintains an iterator cache having multiple iterators. Each active iterator is associated with a most recently used directory entry. Upon receiving an index based request, the iterator closest to the index based request is identified. If the index based request is closer to the top of the directory than it is to the closest active iterator, the directory entries are sequentially examined beginning at the top of the directory with the first entry. Otherwise, the system determines whether the index based request is located above or below the closest iterator. If the index based request is above the closest iterator, the system steps backward beginning with the directory entry associated with the closest iterator until the directory entry associated with the index based request is located. If the closest iterator is located below the closest iterator, the system steps forward through the directory entries beginning with the directory entry associated with the closest iterator until the requested directory entry is located.

## Claims

### Claim 1

A method of locating a directory entry, comprising the steps of:
providing a cache memory storing a plurality of iterators;
receiving an index based request for a directory entry;
identifying an iterator within the cache memory that is closest to the entry associated with the index based request; and
stepping through a set of directory entries beginning at a directory entry corresponding to the iterator closest to the index based request until locating a directory entry corresponding with the index based request.

### Claim 2 (depends on 1)

The method of claim 1 wherein the step of identifying further comprises:
calculating an absolute value difference between the positions of each of a plurality of iterators within the cache memory and the index based request; and
selecting from the plurality of iterators, the iterator having the smallest absolute value difference between its position and the position of the entry associated with the index based request.

### Claim 3 (depends on 2)

The method of claim 2 wherein the step of stepping steps sequentially through the directory entries a number of times equal to the smallest absolute value difference between the closest iterator and the index based request.

### Claim 4 (depends on 1)

The method of claim 1, further comprising the step of accessing the entry associated with the iterator closest to the index based request if the entry associated with the iterator closest to the index based request is the entry associated with the index based request.

### Claim 5 (depends on 1)

The method of claim 1, further comprising the steps of determining relative positions of the closest iterator and the index based request, wherein the if the closest iterator is positioned above the position of the entry associated with the index based request stepping forward through the directory entries and if the closest iterator is positioned below the position stepping backward through the directory entries.

### Claim 6 (depends on 1)

The method of claim 1, further comprising the steps of:
invalidating all iterators within the cache when a directory entry is added to the set of directory entries and when a directory entry is deleted from the set of directory entries; and
revalidating a previously invalidated iterator and associating it with a most recently used directory entry.

### Claim 7

A method of locating an entry in a directory, comprising the steps of:
providing a cache memory storing a plurality of iterators;
receiving an index based request for a directory entry;
identifying an iterator within the cache memory that is closest to the entry associated with the request;
determining whether the entry associated with the request is closer to a first directory entry within the directory than to the closest iterator;
if the requested entry is closer to a first entry within the directory than to the closest iterator then stepping forward through a set of directory entries beginning at the first directory entry within the directory until locating a directory entry corresponding with the request;
if the entry is located above the closest iterator and is closer to the closest iterator than to the first directory entry then stepping backwards through the set of directory entries beginning at the directory entry corresponding to the iterator closest to the index based request until locating the directory entry corresponding with the index based request;
else stepping forward through the set of directory entries beginning at a directory entry corresponding to the iterator closest to the requested until locating the directory entry corresponding with the index based request.

### Claim 8 (depends on 7)

The method of claim 7 wherein the step of identifying further comprises:
calculating an absolute value difference between the positions of each of a plurality of iterators and the position of the requested entry; and
selecting from the plurality of iterators the iterator having the smallest absolute value difference between its position and the position of the requested entry.

### Claim 9 (depends on 7)

The method of claim 7 wherein the step of receiving is performed by an iterator based application programming interface.

### Claim 10

A system for interfacing index based and iterator based computer memory management routines, comprising:
a storage volume storing a set of directory entries;
an index based application programming interface for receiving a request for an entry stored on the volume;
an iterator based application programming interface coupled to the index based application programming interface and coupled to the volume for receiving the index based request from the index based application programming interface and using the index based request to locate the requested entry; and
an iterator cache storing a plurality of active iterators each associated a respective entry stored on the volume and enabling the iterator based application programming interface to locate an active iterator associated with a directory entry closest to the requested directory entry and to use the located iterator to begin with the directory entry closest to the requested directory entry and step sequentially through the set of directory entries until locating the requested directory entry.

### Claim 11 (depends on 10)

The system of claim 10 wherein the iterator based application programming interface determines which of the active iterators is closest to the requested entry by calculating an absolute value difference between the positions of each active iterator and the requested entry and identifying the iterator having the smallest absolute value difference as the closest iterator.

### Claim 12 (depends on 10)

The system of claim 10, further comprising a software application coupled to the index based application programming interface.

### Claim 13 (depends on 10)

The system of claim 10 wherein the iterator based application programming interface determines the relative positions of the directory entry associated with the closest iterator and of the requested directory entry and steps sequentially forward through the set of directory entries if the directory entry associated with the closest iterator is above the requested directory entry.

### Claim 14 (depends on 10)

The system of claim 10 wherein the iterator based application programming interface determines the relative positions of the directory entry associated with the closest iterator and of the requested directory entry and steps sequentially backward through the set of directory entries if the directory entry associated with the closest iterator is located below the requested directory entry.

### Claim 15

A system for interfacing index based and iterator based computer memory management routines, comprising:
a storage volume storing a set of directory entries;
an index based application programming interface for receiving a request for an entry stored on the volume;
an iterator based application programming interface coupled to the index based application programming interface and coupled to the volume for receiving the index based request from the index based application programming interface and using the index based request to locate the requested directory entry; and
an iterator cache storing a plurality of active iterators each associated with a respective entry stored on the volume and enabling the iterator based application programming interface to locate an active iterator associated with a directory entry closest to the requested directory entry and to use the located iterator to begin with the directory entry closest to the requested directory entry and step sequentially through the set of directory entries until locating the requested directory entry unless the directory entry closest to the requested directory entry is located farther from the requested directory entry than a first entry within the directory whereupon the iterator based application interface begins at the first entry within the directory and steps sequentially through the directory entries directory until locating the requested directory entry.

### Claim 16 (depends on 15)

The system of claim 15 wherein the iterator based application programming interface determines which of the active iterators is closest to the requested entry by calculating an absolute value difference between the positions of each active iterator and the requested entry and identifying the iterator having the smallest absolute value difference as the closest iterator.

### Claim 17 (depends on 16)

The system of claim 16 further comprising a software application coupled to the index based application programming interface.

### Claim 18

A computer-readable medium containing instructions for causing a computer to interface an index based routine and an iterator based routine by performing the steps of:
providing a cache memory storing a plurality of iterators;
receiving an index based request for a directory entry;
identifying an iterator within the cache memory that is closest to the entry associated with the index based request; and
stepping through a set of directory entries beginning at a directory entry corresponding to the iterator closest to the index based request until locating a directory entry corresponding with the index based request.

### Claim 19 (depends on 18)

The computer-readable medium of claim 18, further comprising the steps of determining relative positions of the closest iterator and the index based request, wherein if the closest iterator is positioned above the position of the entry associated with the index based request stepping forward through the directory entries and if the closest iterator is positioned below the position of the entry associated with the index based request stepping backward through the directory entries.

### Claim 20

A system for interfacing index based and iterator based routines, comprising:
cache memory means for storing a plurality of iterators;
means for receiving an index based request for a directory entry;
means for identifying an iterator within the cache memory that is closest to the entry associated with the index based request; and
means for stepping through a set of directory entries beginning at a directory entry corresponding to the iterator closest to the index based request until locating a directory entry corresponding with the index based request.
