Information Technology Reference
In-Depth Information
if (error == CE_DISK_FULL)
{
return error;
}
if (error == CE_GOOD)
{
// Read the next sector from the media.
// Get the sector number of the file's current cluster.
l = Cluster2Sector(dsk, fo -> ccls);
// Add the number of the current sector within the cluster.
l += (word)fo -> sec;
// Read the new sector's data.
if (SectorRead( l, dsk -> buffer) != sdcValid)
error = CE_BAD_SECTOR_READ;
sectorloaded = TRUE;
}
} // End: write a sector to the media and read the next sector.
if (error == CE_GOOD)
{
// A sector's data is in the DISK structure's buffer member.
// Copy a byte from the passed buffer (src) to the
// specified offset (pos) in the DISK structure's buffer.
RAMwrite (dsk -> buffer, pos++, *(char *)src);
// Increment the offset of the byte to write.
src = src + 1;
// Increment the offset of the byte within the file.
seek++;
Search WWH ::




Custom Search