Information Technology Reference
In-Depth Information
else
// ForceRead is false, so the entry is the first one in the DISK
// structure's buffer member.
// (from the if (ForceRead | (*curEntry & 0xf) == 0 ) test above)
dir = (DIRENTRY)dsk -> buffer;
}
} // End: read an entry from the media
} // End: a valid cluster was found
else
// The cluster number wasn't valid.
dir = ((DIRENTRY)NULL);
}
else
// ForceRead is false AND curEntry isn't the first entry in the sector.
// OK to read the directory entry directly from the passed DISK structure's buffer.
// (No need to read a sector from the storage media.)
// ((*curEntry) % DIRENTRIES_PER_SECTOR) =
// the number of the entry within the sector.
dir =
(DIRENTRY)((DIRENTRY)dsk -> buffer) +
((*curEntry) % DIRENTRIES_PER_SECTOR);
return(dir);
}
Getting the Main Entry
The LoadDirAttrib function returns a file's 8.3 entry in DIRENTRY struc-
ture. The function accepts a FILEOBJ pointer to a FILE structure (fo) and a
pointer to the number of the file's entry in its directory (fHandle). The func-
tion ignores any long-file-name entries.
The function calls the Cache_File_Entry function in this chapter. In the
passed file structure, the dirclus member must contain the number of the
first cluster of the file's directory.
Search WWH ::




Custom Search