Information Technology Reference
In-Depth Information
// Stop looking on finding a deleted or empty entry
// or on reaching the end of the cluster.
} while ((a == DIR_DEL || a == DIR_EMPTY) && (dir != (DIRENTRY)NULL)
&& (++amountfound < 1));
if (dir == NULL)
{
// It was the cluster's last entry.
// Get the cluster number of the directory.
a = fo -> dirccls;
if (a == 0)
// It's the root directory.
// The root directory is full and can't be expanded in FAT16.
status = NO_MORE;
else
{
// It's not the root directory. Save the current cluster number.
fo -> ccls = a;
// Allocate a new cluster to the directory.
if (FILEallocate_new_cluster(fo) == CE_DISK_FULL)
status = NO_MORE;
else
{
// The first entry (and all entries) in a new cluster are empty.
status = FOUND;
}
}
} // End: It's the cluster's last entry.
Search WWH ::




Custom Search