home *** CD-ROM | disk | FTP | other *** search
- #ifndef FILEREGISTRY_H_
- #define FILEREGISTRY_H_
-
- /*
- File: FileRegistry.h, .cpp
- by Hiep Dam
- Date: Nov 11 95
-
- Opening and handling files is not as easy as the File and
- Resource Manager may have you believe. Even though you
- may specify an fsRdWrPerm permission code, if the file
- is already opened by your application, you will get that
- file's reference number again [which may not be what you
- want]. So it is up to you to prevent users from opening
- your file two or more times.
-
- Thus the file registry below. It keeps an internal list
- of file reference numbers, which you can register. Once
- you register it checks to see if the file reference
- number is already in the registry (and thus already
- opened). This makes things easier for you.
- */
-
- // ---------------------------------------------------------------------------
-
- /*
- Pass the fileRefNum of the opened file to RegisterFile.
- Returns true if file isn't in registry and has been added
- to the registry. Returns false if file is in registry
- already.
- */
- Boolean RegisterFile(short fileRefNum);
-
- /*
- Returns true if file was in registry and has been removed.
- Returns false if file wasn't in registry to begin with.
- */
- Boolean UnregisterFile(short fileRefNum);
-
-
- #endif // FILEREGISTRY