Information Technology Reference
In-Depth Information
// Read the FAT entry for the current cluster.
FATread(disk, c);
// Starting at the cluster immediately following the current cluster number,
// scan through the FAT looking for an empty cluster.
while (c)
{
c++;
// If we get to the end of the FAT, start from the beginning.
if (value == END_CLUSTER || c >= disk -> maxcls)
c = 2;
// If we get to the current cluster, there are no empty entries.
if ( c == curcls)
{
c = 0;
break;
}
// Read an entry.
if ( (value = FATReadQueued(disk, c)) == CLUSTER_FAIL)
{
c = 0;
break;
}
// Quit the loop on finding an empty cluster.
if (value == CLUSTER_EMPTY)
break;
}
return(c);
Search WWH ::




Custom Search