Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 8 - Dictionary Manager / Dictionary Manager Reference
Routines / Compacting a Dictionary


CompactDictionary

The CompactDictionary function compacts the specified dictionary file by removing all garbage data from it.

FUNCTION CompactDictionary (dictionaryReference:LongInt)
                            : OSErr;
dictionaryReference
A number that specifies a particular open dictionary.
DESCRIPTION
The CompactDictionary function removes garbage data by creating a new copy of the dictionary file that contains only valid entries. Once the new dictionary is constructed, the Dictionary Manager deletes the old one.

If there is insufficient disk space to build the new dictonary, CompactDictionary returns the btNoSpace error message, and the original dictionary is preserved intact.

Note that CompactDictionary makes a dictionary file smaller by removing unusable information. It does not actually compress any data.

SPECIAL CONSIDERATIONS
CompactDictionary may move memory; your application should not call this function at interrupt time.

RESULT CODES
In addition to the standard File Manager, Memory Manager, and Resource Manager errors, CompactDictionary may return any of the following result codes.
noErr0No error
notBTree-410File not a dictionary
btNoSpace-413Insufficient disk space to store dictionary information

SEE ALSO
File Manager error codes are described in Inside Macintosh: Files. Memory Manager error codes are described in Inside Macintosh: Memory. Resource Manager error codes are described in Inside Macintosh: More Macintosh Toolbox.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996