typedef struct
{
unsigned char NumEntries; /* number of entries in structure */
char Ref; /* directory reference character */
char Entries[10][4]; /* entry items */
} DirectoryPath;
(This is a packed structure on 1 byte boundaries)
The DirectoryPath structure is modeled after the way in which working directory paths are written and read using the 'CD' DOS command. For example when typing 'CD' in a sub-directory in DOS you may get this:
CD<ENTER>The string that was given by 'CD' has a depth of 3 sub-directories referenced from the root. If this information was to be returned in the DirectoryPath structure then:
NumEntries = 3 (there are 3 entries, one for each sub-directory)This analogy continues to work for setting the working directory with the DOS 'CD' command. For example:
CD \MAIL\WK3\TUES\MORN <ENTER>This command would set the current directory to '\MAIL\WK3\TUES\MORN' as referenced from the root. To do this with the DirectoryPath structure, first set the 'Operation' flag to 0 to set the current directory and fill out the value as:
NumEntries = 4If the current directory is '\MAIL\WK3\TUES\MORN' and the desired directory is '\MAIL\WK3\WED' there is a short cut using the 'CD':
CD .\..\WED <ENTER>This syntax of this command says that from the current directory '.' go to the previous directory '..' and then go to the sub-directory 'WED'. This short cut can also be done with the DirectoryPath structure:
NumEntries = 2 (there are 2 entries)Note that the 'Entries' are left justified and padded with spaces to 4 characters. The sub-directory depth is limited to 10 deep. If the 'NumEntries' is set to or is read to be 0 then the current directory is at the ROOT. Here are the allowable values for all of the components of the DirectoryPath structure:
NumEntries: 0-10