Clarification of Answer by
maniac-ga
on
08 Sep 2002 20:37 PDT
Hello systemspcl,
From your clarification request, I believe you want to verify a
section of disk prior (and make sure your application uses it) prior
to doing data logging. From your description, you believe the best
way is to interpret the FAT 16 "table contents" so you can check the
freep portions of disk prior to running the data logging program.
I will provide an alternative to what you first stated - verify the
disk prior to running the application. This alternative should be
quite a bit easier to implement unless you cannot change the data
logging application.
1. create a file to capture the data, make it large enough for all
the data plus some spare space.
2. read and write the file using a test pattern to verify the area is
OK. This could be a simple application using code similar to your data
logging program (to enhance reuse of your code). It should indicate
success or failure by message and/or error code.
3. change the data logging program to write to the existing file
instead of creating a new file.
This has the advantage of not requiring any special knowledge of how
disk clusters are organized, is portable to other systems, and gives
you a firm guarantee that the data will be written to a good part of
the disk (as just tested). If the test program has problems, you can
either:
- not run the data logging application (since the disk is bad)
OR
- set that file aside as "known bad", create another data logging
file, and repeat the test
If you still want to puruse additional information on FAT 16 "table
contents" and clusters of sectors, please make another clarification
request. I can do research on that data if needed.
--Maniac