Information Technology Reference
In-Depth Information
byte FindEmptyEntries(FILEOBJ fo, word *fHandle)
{
byte a;
byte amountfound;
word bHandle;
DIRENTRY dir;
byte
status = NOT_FOUND;
// Call Cache_File_Entry with the ForceRead parameter = TRUE
// to read the directory's sector from the media into fo -> dsk -> buffer.
// fHandle contains the number of the entry to read in the directory.
if ((dir = Cache_File_Entry(fo, fHandle, TRUE)) == NULL)
{
status = CE_BADCACHEREAD;
}
else
{
while (status == NOT_FOUND)
{
amountfound = 0;
bHandle = *fHandle;
// Look for a deleted or empty entry.
do
{
// Get an entry.
// Set the ForceRead parameter FALSE so the function reads from the media
// only when necessary (when starting a new sector).
dir = Cache_File_Entry(fo, fHandle, FALSE);
// Read the first character of the file name.
a = dir -> DIR_Name[0];
// Increment the entry number.
(*fHandle)++;
Search WWH ::




Custom Search