Information Technology Reference
In-Depth Information
// Decrement the number of bytes remaining to write.
tempo--;
}
if (fo -> Flags.FileWriteEOF)
// The data was appended to the file, so increment the file size.
size++;
} // End: write to the file (except for the last sector).
// If no error, write the final sector's data to the media.
if (error == CE_GOOD)
{
// Get the sector number of the current cluster.
l = Cluster2Sector(dsk, fo -> ccls);
// Add the number of the current sector within the cluster.
l += (word)fo -> sec;
// Copy data from the DISK structure's buffer item to the storage media.
if (SectorWrite(l, dsk->buffer) != sdcValid)
error = CE_WRITE_ERROR;
}
// Save the position within the current sector, the byte number within the file,
// and the file size.
fo->pos = pos;
fo->seek = seek;
fo->size = size;
}
else
error = CE_WRITE_PROTECTED;
}
Search WWH ::




Custom Search