[comp.sys.amiga.programmer] trackdisk.device ETD_ stuff

jap@convex.cl.msu.edu (Joe Porkka) (01/22/91)

In my program which diddles with the floppy disk, I do the following


   DoIO( ETD_WRITE) /* To write out a track of data, in sectors */
   DoIO( ETD_READ) /* To verify it made it to disk okay */

The question being, do I need an ETD_UPDATE in between the
write and the read, to force the READ to actually read from the
disk, and not just from a track buffer in memory?

ccplumb@rose.uwaterloo.ca (Colin Plumb) (01/27/91)

jap@convex.cl.msu.edu (Joe Porkka) wrote:
>In my program which diddles with the floppy disk, I do the following
>
>
>   DoIO( ETD_WRITE) /* To write out a track of data, in sectors */
>   DoIO( ETD_READ) /* To verify it made it to disk okay */
>
>The question being, do I need an ETD_UPDATE in between the
>write and the read, to force the READ to actually read from the
>disk, and not just from a track buffer in memory?

Yes, but it's "worse" than that.  ETD_UPDATE forces the data to be written,
but the track buffer remains valid.  If ETD_UPDATE returns okay, you've
got a high probability of everything being good.  To force a re-read,
you need to use (CMD|ETD)_CLEAR after the UPDATE, which invalidates
the internal buffers.  Then, a READ will have to physically access the
disk.  (Other tricks like reading something else will only work so long
as the trackdisk.device only has one track buffer.)
-- 
	-Colin