Information Technology Reference
In-Depth Information
else
{
// Valid cluster numbers start at 2.
if (c == 0 || c == 1)
{
status = Exit;
}
else
{
c2 = LAST_CLUSTER;
if ( c >= c2)
// The cluster is the last one in the chain.
status = Exit;
// Erase the fat entry by storing an empty-cluster code in the entry.
if (FATwrite(dsk, cluster, CLUSTER_EMPTY) == FAIL)
status = Fail;
// Set the current cluster to the value read from the FAT entry.
cluster = c;
}
}
} // End: while not the end of the chain and no error.
}
if (status == Exit)
// All of the FAT entries in the chain have been erased.
return (TRUE);
else
return(FALSE);
}
The FILEerase function erases a file's directory entry and if requested, the
FAT entries for all of the file's clusters. The function accepts a FILEOBJ
Search WWH ::
Custom Search